Skip to content
Snippets Groups Projects
Commit 00563e15 authored by Matei Zaharia's avatar Matei Zaharia Committed by Tathagata Das
Browse files

SPARK-1879. Increase MaxPermSize since some of our builds have many classes

See https://issues.apache.org/jira/browse/SPARK-1879

 -- builds with Hadoop2 and Hive ran out of PermGen space in spark-shell, when those things added up with the Scala compiler.

Note that users can still override it by setting their own Java options with this change. Their options will come later in the command string than the -XX:MaxPermSize=128m.

Author: Matei Zaharia <matei@databricks.com>

Closes #823 from mateiz/spark-1879 and squashes the following commits:

6bc0ee8 [Matei Zaharia] Increase MaxPermSize to 128m since some of our builds have lots of classes

(cherry picked from commit 5af99d76)
Signed-off-by: default avatarTathagata Das <tathagata.das1565@gmail.com>
parent 901102c1
No related branches found
No related tags found
No related merge requests found
...@@ -99,14 +99,14 @@ else ...@@ -99,14 +99,14 @@ else
fi fi
# Set JAVA_OPTS to be able to load native libraries and to set heap size # Set JAVA_OPTS to be able to load native libraries and to set heap size
JAVA_OPTS="$OUR_JAVA_OPTS" JAVA_OPTS="-XX:MaxPermSize=128m $OUR_JAVA_OPTS"
JAVA_OPTS="$JAVA_OPTS -Xms$OUR_JAVA_MEM -Xmx$OUR_JAVA_MEM" JAVA_OPTS="$JAVA_OPTS -Xms$OUR_JAVA_MEM -Xmx$OUR_JAVA_MEM"
# Load extra JAVA_OPTS from conf/java-opts, if it exists # Load extra JAVA_OPTS from conf/java-opts, if it exists
if [ -e "$FWDIR/conf/java-opts" ] ; then if [ -e "$FWDIR/conf/java-opts" ] ; then
JAVA_OPTS="$JAVA_OPTS `cat $FWDIR/conf/java-opts`" JAVA_OPTS="$JAVA_OPTS `cat $FWDIR/conf/java-opts`"
fi fi
export JAVA_OPTS export JAVA_OPTS
# Attention: when changing the way the JAVA_OPTS are assembled, the change must be reflected in ExecutorRunner.scala! # Attention: when changing the way the JAVA_OPTS are assembled, the change must be reflected in CommandUtils.scala!
if [ ! -f "$FWDIR/RELEASE" ]; then if [ ! -f "$FWDIR/RELEASE" ]; then
# Exit if the user hasn't compiled Spark # Exit if the user hasn't compiled Spark
......
...@@ -77,8 +77,8 @@ rem All drivers use SPARK_JAVA_OPTS + SPARK_DRIVER_MEMORY. The repl also uses SP ...@@ -77,8 +77,8 @@ rem All drivers use SPARK_JAVA_OPTS + SPARK_DRIVER_MEMORY. The repl also uses SP
) )
rem Set JAVA_OPTS to be able to load native libraries and to set heap size rem Set JAVA_OPTS to be able to load native libraries and to set heap size
set JAVA_OPTS=%OUR_JAVA_OPTS% -Djava.library.path=%SPARK_LIBRARY_PATH% -Xms%OUR_JAVA_MEM% -Xmx%OUR_JAVA_MEM% set JAVA_OPTS=-XX:MaxPermSize=128m %OUR_JAVA_OPTS% -Djava.library.path=%SPARK_LIBRARY_PATH% -Xms%OUR_JAVA_MEM% -Xmx%OUR_JAVA_MEM%
rem Attention: when changing the way the JAVA_OPTS are assembled, the change must be reflected in ExecutorRunner.scala! rem Attention: when changing the way the JAVA_OPTS are assembled, the change must be reflected in CommandUtils.scala!
rem Test whether the user has built Spark rem Test whether the user has built Spark
if exist "%FWDIR%RELEASE" goto skip_build_test if exist "%FWDIR%RELEASE" goto skip_build_test
......
...@@ -65,6 +65,8 @@ object CommandUtils extends Logging { ...@@ -65,6 +65,8 @@ object CommandUtils extends Logging {
Seq() Seq()
} }
val permGenOpt = Seq("-XX:MaxPermSize=128m")
// Figure out our classpath with the external compute-classpath script // Figure out our classpath with the external compute-classpath script
val ext = if (System.getProperty("os.name").startsWith("Windows")) ".cmd" else ".sh" val ext = if (System.getProperty("os.name").startsWith("Windows")) ".cmd" else ".sh"
val classPath = Utils.executeAndGetOutput( val classPath = Utils.executeAndGetOutput(
...@@ -73,7 +75,7 @@ object CommandUtils extends Logging { ...@@ -73,7 +75,7 @@ object CommandUtils extends Logging {
val userClassPath = command.classPathEntries ++ Seq(classPath) val userClassPath = command.classPathEntries ++ Seq(classPath)
Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++ Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++
libraryOpts ++ extraOpts ++ workerLocalOpts ++ memoryOpts permGenOpt ++ libraryOpts ++ extraOpts ++ workerLocalOpts ++ memoryOpts
} }
/** Spawn a thread that will redirect a given stream to a file */ /** Spawn a thread that will redirect a given stream to a file */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment