Skip to content

Commit 3b7aed3

Browse files
author
Addison Higham
committed
expose MaxDirectMemorySize via env var
With newer versions of Netty, it appears `MaxDirectMemorySize` needs to be increased for certain uses cases This change exposes an env var, `MAX_DIRECT_MEMORY`, which allows for setting this value
1 parent a880581 commit 3b7aed3

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

bin/manager_start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ GC_OPTS="-XX:+UseConcMarkSweepGC
2222
-XX:MaxPermSize=512m
2323
-XX:+CMSClassUnloadingEnabled "
2424

25-
JAVA_OPTS="-XX:MaxDirectMemorySize=512M
25+
JAVA_OPTS="-XX:MaxDirectMemorySize=$MAX_DIRECT_MEMORY
2626
-XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true"
2727

2828
MAIN="spark.jobserver.JobManager"

bin/server_start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ GC_OPTS="-XX:+UseConcMarkSweepGC
2828
# To truly enable JMX in AWS and other containerized environments, also need to set
2929
# -Djava.rmi.server.hostname equal to the hostname in that environment. This is specific
3030
# depending on AWS vs GCE etc.
31-
JAVA_OPTS="-XX:MaxDirectMemorySize=512M \
31+
JAVA_OPTS="-XX:MaxDirectMemorySize=$MAX_DIRECT_MEMORY \
3232
-XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true \
3333
-Dcom.sun.management.jmxremote.port=9999 \
3434
-Dcom.sun.management.jmxremote.rmi.port=9999 \

bin/setenv.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ if [ -z "$JOBSERVER_MEMORY" ]; then
6161
JOBSERVER_MEMORY=1G
6262
fi
6363

64+
if [ -z "$MAX_DIRECT_MEMORY" ]; then
65+
MAX_DIRECT_MEMORY=512M
66+
fi
67+
6468
# This needs to be exported for standalone mode so drivers can connect to the Spark cluster
6569
export SPARK_HOME
6670
export YARN_CONF_DIR

job-server/config/local.sh.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LOG_DIR=/var/log/job-server
1212
PIDFILE=spark-jobserver.pid
1313
JOBSERVER_MEMORY=1G
1414
SPARK_VERSION=1.6.0
15+
MAX_DIRECT_MEMORY=512M
1516
SPARK_HOME=/home/spark/spark-1.6.0
1617
SPARK_CONF_DIR=$SPARK_HOME/conf
1718
# Only needed for Mesos deploys

0 commit comments

Comments
 (0)