Skip to content

Commit

Permalink
SPARK-5408: Use -XX:MaxPermSize specified by user instead of default …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
jacek-lewandowski authored and srowen committed Feb 7, 2015
1 parent e9a4fe1 commit dd4cb33
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,19 @@ object CommandUtils extends Logging {
val userClassPath = command.classPathEntries ++ Seq(classPath)

val javaVersion = System.getProperty("java.version")
val permGenOpt = if (!javaVersion.startsWith("1.8")) Some("-XX:MaxPermSize=128m") else None

val javaOpts = workerLocalOpts ++ command.javaOpts

val permGenOpt =
if (!javaVersion.startsWith("1.8") && !javaOpts.exists(_.startsWith("-XX:MaxPermSize="))) {
// do not specify -XX:MaxPermSize if it was already specified by user
Some("-XX:MaxPermSize=128m")
} else {
None
}

Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++
permGenOpt ++ workerLocalOpts ++ command.javaOpts ++ memoryOpts
permGenOpt ++ javaOpts ++ memoryOpts
}

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

0 comments on commit dd4cb33

Please sign in to comment.