Skip to content

Commit 2588776

Browse files
jerryshaosrowen
authored andcommitted
[MINOR][CORE][1.6-BACKPORT] Fix display wrong free memory size in the log
## What changes were proposed in this pull request? Free memory size displayed in the log is wrong (used memory), fix to make it correct. Backported to 1.6. ## How was this patch tested? N/A Author: jerryshao <[email protected]> Closes #14043 from jerryshao/memory-log-fix-1.6-backport.
1 parent 7678195 commit 2588776

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/scala/org/apache/spark/storage/MemoryStore.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,8 @@ private[spark] class MemoryStore(blockManager: BlockManager, memoryManager: Memo
393393
}
394394
val valuesOrBytes = if (deserialized) "values" else "bytes"
395395
logInfo("Block %s stored as %s in memory (estimated size %s, free %s)".format(
396-
blockId, valuesOrBytes, Utils.bytesToString(size), Utils.bytesToString(blocksMemoryUsed)))
396+
blockId, valuesOrBytes, Utils.bytesToString(size),
397+
Utils.bytesToString(maxMemory - blocksMemoryUsed)))
397398
} else {
398399
// Tell the block manager that we couldn't put it in memory so that it can drop it to
399400
// disk if the block allows disk storage.

0 commit comments

Comments
 (0)