Skip to content

Commit dd4cb33

Browse files
jacek-lewandowskisrowen
authored andcommitted
SPARK-5408: Use -XX:MaxPermSize specified by user instead of default in ...
...ExecutorRunner and DriverRunner Author: Jacek Lewandowski <[email protected]> Closes apache#4203 from jacek-lewandowski/SPARK-5408-1.3 and squashes the following commits: d913686 [Jacek Lewandowski] SPARK-5408: Use -XX:MaxPermSize specified by used instead of default in ExecutorRunner and DriverRunner
1 parent e9a4fe1 commit dd4cb33

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/worker/CommandUtils.scala

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,19 @@ object CommandUtils extends Logging {
115115
val userClassPath = command.classPathEntries ++ Seq(classPath)
116116

117117
val javaVersion = System.getProperty("java.version")
118-
val permGenOpt = if (!javaVersion.startsWith("1.8")) Some("-XX:MaxPermSize=128m") else None
118+
119+
val javaOpts = workerLocalOpts ++ command.javaOpts
120+
121+
val permGenOpt =
122+
if (!javaVersion.startsWith("1.8") && !javaOpts.exists(_.startsWith("-XX:MaxPermSize="))) {
123+
// do not specify -XX:MaxPermSize if it was already specified by user
124+
Some("-XX:MaxPermSize=128m")
125+
} else {
126+
None
127+
}
128+
119129
Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++
120-
permGenOpt ++ workerLocalOpts ++ command.javaOpts ++ memoryOpts
130+
permGenOpt ++ javaOpts ++ memoryOpts
121131
}
122132

123133
/** Spawn a thread that will redirect a given stream to a file */

0 commit comments

Comments
 (0)