Skip to content
Snippets Groups Projects
Commit 1a5c6fce authored by Abhinav Gupta's avatar Abhinav Gupta Committed by Davies Liu
Browse files

[SPARK-15045] [CORE] Remove dead code in TaskMemoryManager.cleanUpAllAllocatedMemory for pageTable

## What changes were proposed in this pull request?

Removed the DeadCode as suggested.

Author: Abhinav Gupta <abhi.951990@gmail.com>

Closes #12829 from abhi951990/master.
parent 1a9b3415
No related branches found
No related tags found
No related merge requests found
...@@ -379,7 +379,6 @@ public class TaskMemoryManager { ...@@ -379,7 +379,6 @@ public class TaskMemoryManager {
*/ */
public long cleanUpAllAllocatedMemory() { public long cleanUpAllAllocatedMemory() {
synchronized (this) { synchronized (this) {
Arrays.fill(pageTable, null);
for (MemoryConsumer c: consumers) { for (MemoryConsumer c: consumers) {
if (c != null && c.getUsed() > 0) { if (c != null && c.getUsed() > 0) {
// In case of failed task, it's normal to see leaked memory // In case of failed task, it's normal to see leaked memory
...@@ -387,14 +386,16 @@ public class TaskMemoryManager { ...@@ -387,14 +386,16 @@ public class TaskMemoryManager {
} }
} }
consumers.clear(); consumers.clear();
}
for (MemoryBlock page : pageTable) { for (MemoryBlock page : pageTable) {
if (page != null) { if (page != null) {
memoryManager.tungstenMemoryAllocator().free(page); logger.warn("leak a page: " + page + " in task " + taskAttemptId);
memoryManager.tungstenMemoryAllocator().free(page);
}
} }
Arrays.fill(pageTable, null);
} }
Arrays.fill(pageTable, null);
// release the memory that is not used by any consumer. // release the memory that is not used by any consumer.
memoryManager.releaseExecutionMemory(acquiredButNotUsed, taskAttemptId, tungstenMemoryMode); memoryManager.releaseExecutionMemory(acquiredButNotUsed, taskAttemptId, tungstenMemoryMode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment