aboutsummaryrefslogtreecommitdiff
path: root/bin/spark-class
diff options
context:
space:
mode:
authorDaoyuan Wang <daoyuan.wang@intel.com>2014-08-23 08:09:30 -0700
committerPatrick Wendell <pwendell@gmail.com>2014-08-23 08:09:30 -0700
commitf3d65cd0bf34d8c362da492472c61796ef059428 (patch)
tree9f1fd08606c871111431b0cb8d01bd77f04ebf41 /bin/spark-class
parent323cd92b9b762dc3ae456cc97564a71dd6e58244 (diff)
downloadspark-f3d65cd0bf34d8c362da492472c61796ef059428.tar.gz
spark-f3d65cd0bf34d8c362da492472c61796ef059428.tar.bz2
spark-f3d65cd0bf34d8c362da492472c61796ef059428.zip
[SPARK-3068]remove MaxPermSize option for jvm 1.8
In JVM 1.8.0, MaxPermSize is no longer supported. In spark `stderr` output, there would be a line of Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 Author: Daoyuan Wang <daoyuan.wang@intel.com> Closes #2011 from adrian-wang/maxpermsize and squashes the following commits: ef1d660 [Daoyuan Wang] direct get java version in runtime 37db9c1 [Daoyuan Wang] code refine 3c1d554 [Daoyuan Wang] remove MaxPermSize option for jvm 1.8
Diffstat (limited to 'bin/spark-class')
-rwxr-xr-xbin/spark-class7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/spark-class b/bin/spark-class
index 22acf92288..c6543545a5 100755
--- a/bin/spark-class
+++ b/bin/spark-class
@@ -105,9 +105,14 @@ else
exit 1
fi
fi
+JAVA_VERSION=$($RUNNER -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q')
# Set JAVA_OPTS to be able to load native libraries and to set heap size
-JAVA_OPTS="-XX:MaxPermSize=128m $OUR_JAVA_OPTS"
+if [ "$JAVA_VERSION" -ge 18 ]; then
+ JAVA_OPTS="$OUR_JAVA_OPTS"
+else
+ JAVA_OPTS="-XX:MaxPermSize=128m $OUR_JAVA_OPTS"
+fi
JAVA_OPTS="$JAVA_OPTS -Xms$OUR_JAVA_MEM -Xmx$OUR_JAVA_MEM"
# Load extra JAVA_OPTS from conf/java-opts, if it exists