Skip to content

Commit 8bb9b85

Browse files
committed
[EXT][SPARK-15045] [CORE] Remove dead code in TaskMemoryManager.cleanUpAllAllocatedMemory for pageTable apache#12829
1 parent 2820bc1 commit 8bb9b85

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -379,22 +379,22 @@ public long getOffsetInPage(long pagePlusOffsetAddress) {
379379
*/
380380
public long cleanUpAllAllocatedMemory() {
381381
synchronized (this) {
382-
Arrays.fill(pageTable, null);
383382
for (MemoryConsumer c: consumers) {
384383
if (c != null && c.getUsed() > 0) {
385384
// In case of failed task, it's normal to see leaked memory
386385
logger.warn("leak " + Utils.bytesToString(c.getUsed()) + " memory from " + c);
387386
}
388387
}
389388
consumers.clear();
390-
}
391389

392-
for (MemoryBlock page : pageTable) {
393-
if (page != null) {
394-
memoryManager.tungstenMemoryAllocator().free(page);
390+
for (MemoryBlock page : pageTable) {
391+
if (page != null) {
392+
logger.warn("leak a page: " + page + " in task " + taskAttemptId);
393+
memoryManager.tungstenMemoryAllocator().free(page);
394+
}
395395
}
396+
Arrays.fill(pageTable, null);
396397
}
397-
Arrays.fill(pageTable, null);
398398

399399
// release the memory that is not used by any consumer.
400400
memoryManager.releaseExecutionMemory(acquiredButNotUsed, taskAttemptId, tungstenMemoryMode);

0 commit comments

Comments
 (0)