AngersZhuuuu commented on a change in pull request #28541:
URL: https://github.com/apache/spark/pull/28541#discussion_r446591334



##########
File path: core/src/main/scala/org/apache/spark/memory/ExecutionMemoryPool.scala
##########
@@ -105,11 +106,12 @@ private[memory] class ExecutionMemoryPool(
       lock.notifyAll()
     }
 
+    var waitTimes = 0
     // Keep looping until we're either sure that we don't want to grant this 
request (because this
     // task would have more than 1 / numActiveTasks of the memory) or we have 
enough free
     // memory to give it (we always let each task get at least 1 / (2 * 
numActiveTasks)).
     // TODO: simplify this to limit each task to its own slot
-    while (true) {
+    while (waitTimes < 3) {

Review comment:
       > This doesn't look like a general optimization to me, but depends on 
the specific runtime environment.
   
   Yeah, only optimize some special case




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to