File tree Expand file tree Collapse file tree
core/src/main/java/org/apache/spark/memory Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments