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

    https://github.com/apache/spark/pull/9241#discussion_r43442805
  
    --- Diff: core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java 
---
    @@ -261,17 +397,14 @@ public long getOffsetInPage(long 
pagePlusOffsetAddress) {
        * value can be used to detect memory leaks.
        */
       public long cleanUpAllAllocatedMemory() {
    -    long freedBytes = 0;
    -    for (MemoryBlock page : pageTable) {
    -      if (page != null) {
    -        freedBytes += page.size();
    -        freePage(page);
    +    synchronized (this) {
    +      Arrays.fill(pageTable, null);
    +      for (MemoryConsumer c: consumers.keySet()) {
    +        logger.warn("leak " + Utils.bytesToString(consumers.get(c)) + " 
memory from " + c);
    --- End diff --
    
    Just to clarify: is the memory leaked by these consumers also accounted for 
in the value returned by `releaseAllExecutionMemoryForTask`? Just want to make 
sure that this method's return value doesn't under- or over-count leaked memory.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to