spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davies <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-15045] [CORE] Remove dead code in TaskM...
Date Wed, 04 May 2016 23:22:43 GMT
Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12829#discussion_r62130992
  
    --- Diff: core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java ---
    @@ -389,12 +389,6 @@ public long cleanUpAllAllocatedMemory() {
           consumers.clear();
         }
     
    -    for (MemoryBlock page : pageTable) {
    --- End diff --
    
    Chatted with @JoshRosen , these lines are introduce by logical conflict, it could be rewritten
as
    ```scala
        synchronized (this) {
          for (MemoryConsumer c: consumers) {
            if (c != null && c.getUsed() > 0) {
              // In case of failed task, it's normal to see leaked memory
              logger.warn("leak " + Utils.bytesToString(c.getUsed()) + " memory from " + c);
            }
          }
          consumers.clear();
    
          for (MemoryBlock page : pageTable) {
            if (page != null) {
              logger.warn("leak a page: " + page + " in task " + taskAttemptId);
              memoryManager.tungstenMemoryAllocator().free(page);
            }
          }
          Arrays.fill(pageTable, null);
        }
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message