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 8b09533a510 DataNode exit directly while meeting OutOfMemoryError
8b09533a510 is described below

commit 8b09533a51022218fa2badc2c417a118a068ef01
Author: JackieTien97 <[email protected]>
AuthorDate: Mon Nov 13 19:21:29 2023 +0800

    DataNode exit directly while meeting OutOfMemoryError
---
 iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat | 1 +
 iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh  | 1 +
 2 files changed, 2 insertions(+)

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 16ad87390f0..bbbbe46b074 100644
--- a/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat
+++ b/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.bat
@@ -120,6 +120,7 @@ set /a 
MAX_CACHED_BUFFER_SIZE=%off_heap_memory_size_in_mb%/%IO_THREADS_NUMBER%*1
 set IOTDB_HEAP_OPTS=-Xmx%ON_HEAP_MEMORY% -Xms%ON_HEAP_MEMORY%
 set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -XX:MaxDirectMemorySize=%OFF_HEAP_MEMORY%
 set IOTDB_HEAP_OPTS=%IOTDB_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\heapdump.hprof
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 8dcf93cb149..7a3c5fa45d1 100755
--- a/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh
+++ b/iotdb-core/datanode/src/assembly/resources/conf/datanode-env.sh
@@ -268,6 +268,7 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xms${ON_HEAP_MEMORY}"
 IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Xmx${ON_HEAP_MEMORY}"
 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"
 

Reply via email to