Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10170#discussion_r47028931
  
    --- Diff: 
core/src/test/scala/org/apache/spark/memory/UnifiedMemoryManagerSuite.scala ---
    @@ -154,32 +177,34 @@ class UnifiedMemoryManagerSuite extends 
MemoryManagerSuite with PrivateMethodTes
         assert(mm.acquireExecutionMemory(800L, taskAttemptId, 
MemoryMode.ON_HEAP) === 800L)
         assert(mm.executionMemoryUsed === 800L)
         assert(mm.storageMemoryUsed === 0L)
    -    assertEnsureFreeSpaceNotCalled(ms)
    +    assertEvictBlocksToFreeSpaceNotCalled(ms)
         // Storage should not be able to evict execution
         assert(mm.acquireStorageMemory(dummyBlock, 100L, evictedBlocks))
         assert(mm.executionMemoryUsed === 800L)
         assert(mm.storageMemoryUsed === 100L)
    -    assertEnsureFreeSpaceCalled(ms, 100L)
    +    assertEvictBlocksToFreeSpaceNotCalled(ms)
         assert(!mm.acquireStorageMemory(dummyBlock, 250L, evictedBlocks))
         assert(mm.executionMemoryUsed === 800L)
         assert(mm.storageMemoryUsed === 100L)
    -    assertEnsureFreeSpaceCalled(ms, 250L)
    +    assertEvictBlocksToFreeSpaceCalled(ms, 150L) // try to evict blocks ...
    --- End diff --
    
    If you take my suggestion from above about adding the preemptive check, 
then this will not be called. (i.e. we know there's only 100B of blocks so 
don't bother trying to free 150B out of it)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to