File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
alpha/src/main/scala/org/apache/spark/deploy/yarn
common/src/main/scala/org/apache/spark/deploy/yarn
stable/src/main/scala/org/apache/spark/deploy/yarn Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ private[yarn] class YarnAllocationHandler(
8989 private val pendingReleaseContainers = new ConcurrentHashMap [ContainerId , Boolean ]
9090
9191 // Additional memory overhead - in mb.
92- private val memoryOverhead = sparkConf.getInt(" spark.yarn.container.memoryOverhead" , 384 )
92+ private val memoryOverhead = sparkConf.getInt(" spark.yarn.container.memoryOverhead" ,
93+ YarnAllocationHandler .MEMORY_OVERHEAD )
9394
9495 private val numExecutorsRunning = new AtomicInteger ()
9596 // Used to generate a unique id per executor
@@ -547,6 +548,9 @@ object YarnAllocationHandler {
547548 // request types (like map/reduce in hadoop for example)
548549 val PRIORITY = 1
549550
551+ // Additional memory overhead - in mb
552+ val MEMORY_OVERHEAD = 384
553+
550554 // Host to rack map - saved from allocation requests
551555 // We are expecting this not to change.
552556 // Note that it is possible for this to change : and RM will indicate that to us via update
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ trait ClientBase extends Logging {
6666 FsPermission .createImmutable(Integer .parseInt(" 644" , 8 ).toShort)
6767
6868 // Additional memory overhead - in mb.
69- def memoryOverhead = sparkConf.getInt(" spark.yarn.container.memoryOverhead" , 384 )
69+ def memoryOverhead = sparkConf.getInt(" spark.yarn.container.memoryOverhead" ,
70+ YarnAllocationHandler .MEMORY_OVERHEAD )
7071
7172 // TODO(harvey): This could just go in ClientArguments.
7273 def validateArgs () = {
Original file line number Diff line number Diff line change @@ -90,8 +90,11 @@ private[yarn] class YarnAllocationHandler(
9090 // Containers to be released in next request to RM
9191 private val pendingReleaseContainers = new ConcurrentHashMap [ContainerId , Boolean ]
9292
93+ // TODO: Here we can dynamically calculate the default value.
94+ // eg: val memoryOverhead = (executorMemory * 0.25D).ceil.toInt
9395 // Additional memory overhead - in mb.
94- private val memoryOverhead = sparkConf.getInt(" spark.yarn.container.memoryOverhead" , 384 )
96+ private val memoryOverhead = sparkConf.getInt(" spark.yarn.container.memoryOverhead" ,
97+ YarnAllocationHandler .MEMORY_OVERHEAD )
9598
9699 // Number of container requests that have been sent to, but not yet allocated by the
97100 // ApplicationMaster.
@@ -561,6 +564,9 @@ object YarnAllocationHandler {
561564 // request types (like map/reduce in hadoop for example)
562565 val PRIORITY = 1
563566
567+ // Additional memory overhead - in mb.
568+ val MEMORY_OVERHEAD = 384
569+
564570 // Host to rack map - saved from allocation requests. We are expecting this not to change.
565571 // Note that it is possible for this to change : and ResurceManager will indicate that to us via
566572 // update response to allocate. But we are punting on handling that for now.
You can’t perform that action at this time.
0 commit comments