File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
core/src/main/scala/org/apache/spark/deploy/worker Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments