Skip to content
Snippets Groups Projects
Commit 8c95a854 authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Use Runtime.maxMemory instead of Runtime.totalMemory in

BoundedMemoryCache, in case the JVM was not started with its initial
heap size equaling its maximum one (-Xms == -Xmx).
parent d46f662c
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ class BoundedMemoryCache extends Cache with Logging { ...@@ -49,7 +49,7 @@ class BoundedMemoryCache extends Cache with Logging {
private def getMaxBytes(): Long = { private def getMaxBytes(): Long = {
val memoryFractionToUse = System.getProperty( val memoryFractionToUse = System.getProperty(
"spark.boundedMemoryCache.memoryFraction", "0.66").toDouble "spark.boundedMemoryCache.memoryFraction", "0.66").toDouble
(Runtime.getRuntime.totalMemory * memoryFractionToUse).toLong (Runtime.getRuntime.maxMemory * memoryFractionToUse).toLong
} }
/** /**
......
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