Skip to content

Commit 06b9d62

Browse files
peterabledasrowen
authored andcommitted
[SPARK-14633] Use more readable format to show memory bytes in Error Message
## What changes were proposed in this pull request? Round memory bytes and convert it to Long to it’s original type. This change fixes the formatting issue in the Exception message. ## How was this patch tested? Manual tests were done in CDH cluster. Author: Peter Ableda <[email protected]> Closes #12392 from peterableda/SPARK-14633.
1 parent e249232 commit 06b9d62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ object UnifiedMemoryManager {
206206
val systemMemory = conf.getLong("spark.testing.memory", Runtime.getRuntime.maxMemory)
207207
val reservedMemory = conf.getLong("spark.testing.reservedMemory",
208208
if (conf.contains("spark.testing")) 0 else RESERVED_SYSTEM_MEMORY_BYTES)
209-
val minSystemMemory = reservedMemory * 1.5
209+
val minSystemMemory = (reservedMemory * 1.5).ceil.toLong
210210
if (systemMemory < minSystemMemory) {
211211
throw new IllegalArgumentException(s"System memory $systemMemory must " +
212212
s"be at least $minSystemMemory. Please increase heap size using the --driver-memory " +

0 commit comments

Comments
 (0)