From f239909c57d16ad109767f9342f18b314fd412e4 Mon Sep 17 00:00:00 2001 From: uce Date: Thu, 12 Jun 2014 21:08:06 +0200 Subject: [PATCH] [FLINK-934] Remove default values for JobManager and TaskManager JVM heap sizes in startup scripts --- stratosphere-dist/src/main/stratosphere-bin/bin/config.sh | 6 ++---- .../src/main/stratosphere-bin/bin/jobmanager.sh | 6 +++++- .../src/main/stratosphere-bin/bin/taskmanager.sh | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/stratosphere-dist/src/main/stratosphere-bin/bin/config.sh b/stratosphere-dist/src/main/stratosphere-bin/bin/config.sh index 79c733aa4e9c2..bd6c30281cc6b 100755 --- a/stratosphere-dist/src/main/stratosphere-bin/bin/config.sh +++ b/stratosphere-dist/src/main/stratosphere-bin/bin/config.sh @@ -62,8 +62,6 @@ readFromConfig() { # WARNING !!! , these values are only used if there is nothing else is specified in # conf/stratosphere-conf.yaml -DEFAULT_JOBM_HEAP_MB=256 # Java heap size for the JobManager (in MB) -DEFAULT_TASKM_HEAP_MB=512 # Java heap size for the TaskManager (in MB) DEFAULT_ENV_PID_DIR="/tmp" # Directory to store *.pid files to DEFAULT_ENV_LOG_MAX=5 # Maximum number of old log files to keep DEFAULT_ENV_JAVA_OPTS="" # Optional JVM args @@ -153,12 +151,12 @@ fi # Define STRATOSPHERE_JM_HEAP if it is not already set if [ -z "${STRATOSPHERE_JM_HEAP}" ]; then - STRATOSPHERE_JM_HEAP=$(readFromConfig ${KEY_JOBM_HEAP_MB} ${DEFAULT_JOBM_HEAP_MB} "${YAML_CONF}") + STRATOSPHERE_JM_HEAP=$(readFromConfig ${KEY_JOBM_HEAP_MB} 0 "${YAML_CONF}") fi # Define STRATOSPHERE_TM_HEAP if it is not already set if [ -z "${STRATOSPHERE_TM_HEAP}" ]; then - STRATOSPHERE_TM_HEAP=$(readFromConfig ${KEY_TASKM_HEAP_MB} ${DEFAULT_TASKM_HEAP_MB} "${YAML_CONF}") + STRATOSPHERE_TM_HEAP=$(readFromConfig ${KEY_TASKM_HEAP_MB} 0 "${YAML_CONF}") fi if [ -z "${MAX_LOG_FILE_NUMBER}" ]; then diff --git a/stratosphere-dist/src/main/stratosphere-bin/bin/jobmanager.sh b/stratosphere-dist/src/main/stratosphere-bin/bin/jobmanager.sh index 777458c793a83..d41874c3f2653 100755 --- a/stratosphere-dist/src/main/stratosphere-bin/bin/jobmanager.sh +++ b/stratosphere-dist/src/main/stratosphere-bin/bin/jobmanager.sh @@ -26,7 +26,11 @@ if [ "$EXECUTIONMODE" = "local" ]; then STRATOSPHERE_JM_HEAP=`expr $STRATOSPHERE_JM_HEAP + $STRATOSPHERE_TM_HEAP` fi -JVM_ARGS="$JVM_ARGS -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xms"$STRATOSPHERE_JM_HEAP"m -Xmx"$STRATOSPHERE_JM_HEAP"m" +JVM_ARGS="$JVM_ARGS -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m" + +if [ "$STRATOSPHERE_JM_HEAP" -gt 0 ]; then + JVM_ARGS="$JVM_ARGS -Xms"$STRATOSPHERE_JM_HEAP"m -Xmx"$STRATOSPHERE_JM_HEAP"m" +fi if [ "$STRATOSPHERE_IDENT_STRING" = "" ]; then STRATOSPHERE_IDENT_STRING="$USER" diff --git a/stratosphere-dist/src/main/stratosphere-bin/bin/taskmanager.sh b/stratosphere-dist/src/main/stratosphere-bin/bin/taskmanager.sh index 3f65d3263ef4e..0800be60a591a 100755 --- a/stratosphere-dist/src/main/stratosphere-bin/bin/taskmanager.sh +++ b/stratosphere-dist/src/main/stratosphere-bin/bin/taskmanager.sh @@ -47,7 +47,11 @@ out=$STRATOSPHERE_LOG_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-taskmanager-$H pid=$STRATOSPHERE_PID_DIR/stratosphere-$STRATOSPHERE_IDENT_STRING-taskmanager.pid log_setting=(-Dlog.file="$log" -Dlog4j.configuration=file:"$STRATOSPHERE_CONF_DIR"/log4j.properties) -JVM_ARGS="$JVM_ARGS -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -XX:NewRatio=6 -Xms"$STRATOSPHERE_TM_HEAP"m -Xmx"$STRATOSPHERE_TM_HEAP"m" +JVM_ARGS="$JVM_ARGS -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -XX:NewRatio=6" + +if [ "$STRATOSPHERE_TM_HEAP" -gt 0 ]; then + JVM_ARGS="$JVM_ARGS -Xms"$STRATOSPHERE_TM_HEAP"m -Xmx"$STRATOSPHERE_TM_HEAP"m" +fi case $STARTSTOP in