This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch OOMExit
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/OOMExit by this push:
new e86bd83142d ConfigNode exit directly while meeting OutOfMemoryError
e86bd83142d is described below
commit e86bd83142d8ce6c840e6226c6acfa210ba798bb
Author: JackieTien97 <[email protected]>
AuthorDate: Mon Nov 13 19:24:04 2023 +0800
ConfigNode exit directly while meeting OutOfMemoryError
---
iotdb-core/confignode/src/assembly/resources/conf/confignode-env.bat | 4 ++++
iotdb-core/confignode/src/assembly/resources/conf/confignode-env.sh | 3 +++
iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat | 2 +-
iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh | 2 +-
4 files changed, 9 insertions(+), 2 deletions(-)
diff --git
a/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.bat
b/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.bat
index 263fa0d328e..050b9ad423c 100644
--- a/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.bat
+++ b/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.bat
@@ -121,6 +121,10 @@ set /a
MAX_CACHED_BUFFER_SIZE=%off_heap_memory_size_in_mb%/%IO_THREADS_NUMBER%*1
set CONFIGNODE_HEAP_OPTS=-Xmx%ON_HEAP_MEMORY% -Xms%ON_HEAP_MEMORY%
set CONFIGNODE_HEAP_OPTS=%CONFIGNODE_HEAP_OPTS%
-XX:MaxDirectMemorySize=%OFF_HEAP_MEMORY%
set CONFIGNODE_HEAP_OPTS=%CONFIGNODE_HEAP_OPTS%
-Djdk.nio.maxCachedBufferSize=%MAX_CACHED_BUFFER_SIZE%
+set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -XX:+ExitOnOutOfMemoryError
+
+@REM 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
+@REM IOTDB_JMX_OPTS=%IOTDB_HEAP_OPTS% -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=\tmp\confignode_heapdump.hprof
@REM You can put your env variable here
@REM set JAVA_HOME=%JAVA_HOME%
diff --git
a/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.sh
b/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.sh
index c77d787b628..d12ff45fd23 100644
--- a/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.sh
+++ b/iotdb-core/confignode/src/assembly/resources/conf/confignode-env.sh
@@ -273,6 +273,9 @@ CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS
-Xms${ON_HEAP_MEMORY}"
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -Xmx${ON_HEAP_MEMORY}"
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS
-XX:MaxDirectMemorySize=${OFF_HEAP_MEMORY}"
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS
-Djdk.nio.maxCachedBufferSize=${MAX_CACHED_BUFFER_SIZE}"
+IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+ExitOnOutOfMemoryError"
+# 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
+#IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/tmp/confignode_heapdump.hprof"
echo "ConfigNode on heap memory size = ${ON_HEAP_MEMORY}B, off heap memory
size = ${OFF_HEAP_MEMORY}B"
echo "If you want to change this configuration, please check
conf/confignode-env.sh."
diff --git a/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat
b/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat
index bbbbe46b074..0c039f2f3f3 100644
--- a/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat
+++ b/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat
@@ -123,7 +123,7 @@ set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS%
-Djdk.nio.maxCachedBufferSize=%MAX_CACHED_
set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -XX:+ExitOnOutOfMemoryError
@REM 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
-@REM IOTDB_JMX_OPTS=%IOTDB_HEAP_OPTS% -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=\tmp\heapdump.hprof
+@REM IOTDB_JMX_OPTS=%IOTDB_HEAP_OPTS% -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=\tmp\datanode_heapdump.hprof
@REM You can put your env variable here
@REM set JAVA_HOME=%JAVA_HOME%
diff --git a/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh
b/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh
index 7a3c5fa45d1..b37210c9d7c 100755
--- a/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh
+++ b/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh
@@ -270,7 +270,7 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS
-XX:MaxDirectMemorySize=${OFF_HEAP_MEMORY}"
IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS
-Djdk.nio.maxCachedBufferSize=${MAX_CACHED_BUFFER_SIZE}"
IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+ExitOnOutOfMemoryError"
# 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
-#IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/tmp/heapdump.hprof"
+#IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+HeapDumpOnOutOfMemoryError
-XX:HeapDumpPath=/tmp/datanode_heapdump.hprof"
echo "DataNode on heap memory size = ${ON_HEAP_MEMORY}B, off heap memory size
= ${OFF_HEAP_MEMORY}B"