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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]