aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/scala
diff options
context:
space:
mode:
authorPeter Ableda <peter.ableda@cloudera.com>2016-04-15 13:18:48 +0100
committerSean Owen <sowen@cloudera.com>2016-04-15 13:18:48 +0100
commit06b9d623e8f58d7bd450a50d938f83b4b3472a32 (patch)
treeef66fac6c96e7b14e3c647dd79c5da310b43316c /core/src/main/scala
parente24923267f79e7fc03180095fcbb28a91f998f5d (diff)
downloadspark-06b9d623e8f58d7bd450a50d938f83b4b3472a32.tar.gz
spark-06b9d623e8f58d7bd450a50d938f83b4b3472a32.tar.bz2
spark-06b9d623e8f58d7bd450a50d938f83b4b3472a32.zip
[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 <peter.ableda@cloudera.com> Closes #12392 from peterableda/SPARK-14633.
Diffstat (limited to 'core/src/main/scala')
-rw-r--r--core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala b/core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala
index fa9c021f70..82023b533d 100644
--- a/core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala
+++ b/core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala
@@ -206,7 +206,7 @@ object UnifiedMemoryManager {
val systemMemory = conf.getLong("spark.testing.memory", Runtime.getRuntime.maxMemory)
val reservedMemory = conf.getLong("spark.testing.reservedMemory",
if (conf.contains("spark.testing")) 0 else RESERVED_SYSTEM_MEMORY_BYTES)
- val minSystemMemory = reservedMemory * 1.5
+ val minSystemMemory = (reservedMemory * 1.5).ceil.toLong
if (systemMemory < minSystemMemory) {
throw new IllegalArgumentException(s"System memory $systemMemory must " +
s"be at least $minSystemMemory. Please increase heap size using the --driver-memory " +