Repository: spark Updated Branches: refs/heads/master e24923267 -> 06b9d623e
[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. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/06b9d623 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/06b9d623 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/06b9d623 Branch: refs/heads/master Commit: 06b9d623e8f58d7bd450a50d938f83b4b3472a32 Parents: e249232 Author: Peter Ableda <[email protected]> Authored: Fri Apr 15 13:18:48 2016 +0100 Committer: Sean Owen <[email protected]> Committed: Fri Apr 15 13:18:48 2016 +0100 ---------------------------------------------------------------------- .../main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/06b9d623/core/src/main/scala/org/apache/spark/memory/UnifiedMemoryManager.scala ---------------------------------------------------------------------- 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 fa9c021..82023b5 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 " + --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
