[MINOR][CORE] 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.

## How was this patch tested?

N/A

Author: jerryshao <sshao@hortonworks.com>

Closes #13804 from jerryshao/memory-log-fix.
This commit is contained in:
jerryshao 2016-06-27 09:23:58 +01:00 committed by Sean Owen
parent b452026324
commit 52d4fe0579

View file

@ -377,7 +377,8 @@ private[spark] class MemoryStore(
entries.put(blockId, entry)
}
logInfo("Block %s stored as bytes in memory (estimated size %s, free %s)".format(
blockId, Utils.bytesToString(entry.size), Utils.bytesToString(blocksMemoryUsed)))
blockId, Utils.bytesToString(entry.size),
Utils.bytesToString(maxMemory - blocksMemoryUsed)))
Right(entry.size)
} else {
// We ran out of space while unrolling the values for this block