Skip to content

Commit 52b4e45

Browse files
author
Chris Cope
committed
[SPARK-2140] Updating heap memory calculation for YARN stable and alpha.
1 parent 00362da commit 52b4e45

File tree

2 files changed

+1
-10
lines changed
  • yarn
    • alpha/src/main/scala/org/apache/spark/deploy/yarn
    • stable/src/main/scala/org/apache/spark/deploy/yarn

2 files changed

+1
-10
lines changed

yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
104104
}
105105

106106
def calculateAMMemory(newApp: GetNewApplicationResponse): Int = {
107-
val minResMemory = newApp.getMinimumResourceCapability().getMemory()
108-
val amMemory = ((args.amMemory / minResMemory) * minResMemory) +
109-
((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
110-
memoryOverhead)
111-
amMemory
107+
args.amMemory
112108
}
113109

114110
def setupSecurityToken(amContainer: ContainerLaunchContext) = {

yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,6 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
104104
}
105105

106106
def calculateAMMemory(newApp: GetNewApplicationResponse) :Int = {
107-
// TODO: Need a replacement for the following code to fix -Xmx?
108-
// val minResMemory: Int = newApp.getMinimumResourceCapability().getMemory()
109-
// var amMemory = ((args.amMemory / minResMemory) * minResMemory) +
110-
// ((if ((args.amMemory % minResMemory) == 0) 0 else minResMemory) -
111-
// memoryOverhead )
112107
args.amMemory
113108
}
114109

0 commit comments

Comments
 (0)