@@ -148,6 +148,38 @@ calculate_memory_sizes()
148148 OFF_HEAP_MEMORY=" ${off_heap_memory_size_in_mb} M"
149149}
150150
151+ CONFIGNODE_CONF_DIR=" ` dirname " $0 " ` "
152+ get_cn_system_dir () {
153+ local config_file=" $1 "
154+ local cn_system_dir=" "
155+
156+ cn_system_dir=` sed ' /^cn_system_dir=/!d;s/.*=//' ${CONFIGNODE_CONF_DIR} /${config_file} | tail -n 1`
157+
158+ if [ -z " $cn_system_dir " ]; then
159+ echo " "
160+ return 0
161+ fi
162+
163+ if [[ " $cn_system_dir " == /* ]]; then
164+ echo " $cn_system_dir "
165+ else
166+ echo " $CONFIGNODE_CONF_DIR /../$cn_system_dir "
167+ fi
168+ }
169+
170+ if [ -f " ${CONFIGNODE_CONF_DIR} /iotdb-system.properties" ]; then
171+ heap_dump_dir=$( get_cn_system_dir " iotdb-system.properties" )
172+ else
173+ heap_dump_dir=$( get_cn_system_dir " iotdb-confignode.properties" )
174+ fi
175+
176+ if [ -z " $heap_dump_dir " ]; then
177+ heap_dump_dir=" $( dirname " $0 " ) /../data/confignode/system"
178+ fi
179+
180+ if [ ! -d " $heap_dump_dir " ]; then
181+ mkdir -p " $heap_dump_dir "
182+ fi
151183
152184# find java in JAVA_HOME
153185if [ -n " $JAVA_HOME " ]; then
@@ -275,7 +307,7 @@ CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -XX:MaxDirectMemorySize=${OFF_HEAP_MEM
275307CONFIGNODE_JMX_OPTS=" $CONFIGNODE_JMX_OPTS -Djdk.nio.maxCachedBufferSize=${MAX_CACHED_BUFFER_SIZE} "
276308IOTDB_JMX_OPTS=" $IOTDB_JMX_OPTS -XX:+CrashOnOutOfMemoryError"
277309# if you want to dump the heap memory while OOM happening, you can use the following command, remember to replace /tmp/heapdump.hprof with your own file path and the folder where this file is located needs to be created in advance
278- # IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp /confignode_heapdump.hprof"
310+ # IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${heap_dump_dir} /confignode_heapdump.hprof"
279311
280312echo " ConfigNode on heap memory size = ${ON_HEAP_MEMORY} B, off heap memory size = ${OFF_HEAP_MEMORY} B"
281313echo " If you want to change this configuration, please check conf/confignode-env.sh."
0 commit comments