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).
This commit is contained in:
Matei Zaharia 2012-03-30 13:38:19 -04:00
parent d46f662c5b
commit 8c95a85438

View file

@ -49,7 +49,7 @@ class BoundedMemoryCache extends Cache with Logging {
private def getMaxBytes(): Long = {
val memoryFractionToUse = System.getProperty(
"spark.boundedMemoryCache.memoryFraction", "0.66").toDouble
(Runtime.getRuntime.totalMemory * memoryFractionToUse).toLong
(Runtime.getRuntime.maxMemory * memoryFractionToUse).toLong
}
/**