xintongsong commented on a change in pull request #9801: [FLINK-13983][runtime]
Launch task executor with new memory calculation logics
URL: https://github.com/apache/flink/pull/9801#discussion_r334728535
##########
File path: flink-dist/src/main/flink-bin/bin/taskmanager.sh
##########
@@ -44,32 +44,18 @@ if [[ $STARTSTOP == "start" ]] || [[ $STARTSTOP ==
"start-foreground" ]]; then
export JVM_ARGS="$JVM_ARGS -XX:+UseG1GC"
fi
- if [ ! -z "${FLINK_TM_HEAP_MB}" ] && [ "${FLINK_TM_HEAP}" == 0 ]; then
- echo "used deprecated key \`${KEY_TASKM_MEM_MB}\`, please replace
with key \`${KEY_TASKM_MEM_SIZE}\`"
- else
- flink_tm_heap_bytes=$(parseBytes ${FLINK_TM_HEAP})
- FLINK_TM_HEAP_MB=$(getMebiBytes ${flink_tm_heap_bytes})
- fi
-
- if [[ ! ${FLINK_TM_HEAP_MB} =~ ${IS_NUMBER} ]] || [[ "${FLINK_TM_HEAP_MB}"
-lt "0" ]]; then
- echo "[ERROR] Configured TaskManager JVM heap size is not a number.
Please set '${KEY_TASKM_MEM_SIZE}' in ${FLINK_CONF_FILE}."
- exit 1
- fi
-
- if [ "${FLINK_TM_HEAP_MB}" -gt "0" ]; then
-
- TM_HEAP_SIZE=$(calculateTaskManagerHeapSizeMB)
- # Long.MAX_VALUE in TB: This is an upper bound, much less direct
memory will be used
- TM_MAX_OFFHEAP_SIZE="8388607T"
-
- export JVM_ARGS="${JVM_ARGS} -Xms${TM_HEAP_SIZE}M -Xmx${TM_HEAP_SIZE}M
-XX:MaxDirectMemorySize=${TM_MAX_OFFHEAP_SIZE}"
-
- fi
-
# Add TaskManager-specific JVM options
export FLINK_ENV_JAVA_OPTS="${FLINK_ENV_JAVA_OPTS}
${FLINK_ENV_JAVA_OPTS_TM}"
# Startup parameters
+
dynamic_configs_and_jvm_params=$(getTmResourceDynamicConfigsAndExportJvmParams)
+ IFS=$'\n' lines=(${dynamic_configs_and_jvm_params})
+
+ jvm_params=${lines[0]}
+ export JVM_ARGS="${JVM_ARGS} ${jvm_params}"
+
+ IFS=' ' dynamic_configs=(${lines[1]})
+ ARGS=(${ARGS[@]} ${dynamic_configs[@]})
Review comment:
Thanks, I'll try that.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services