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:
parent
d46f662c5b
commit
8c95a85438
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue