Skip to content
Permalink
Browse files
[ISSUE-3232] fix the bug of Memory Information in Windows host (#3231)
  • Loading branch information
xiaoyekanren committed May 20, 2021
1 parent 2147526 commit 48328e381ffca0f3fd997057c30c378667fa3dbe
Showing 1 changed file with 6 additions and 6 deletions.
@@ -67,8 +67,8 @@ set system_memory_in_mb=%system_memory_in_mb:,=%
set /a half_=%system_memory_in_mb%/2
set /a quarter_=%half_%/2

if ["%half_%"] GTR ["1024"] set half_=1024
if ["%quarter_%"] GTR ["65536"] set quarter_=65536
if ["%half_%"] GTR ["1024"] set %half_%=1024
if ["%quarter_%"] GTR ["65536"] set %quarter_%=65536

if ["%half_%"] GTR ["quarter_"] (
set max_heap_size_in_mb=%half_%
@@ -87,7 +87,6 @@ IF ["%IOTDB_HEAP_OPTS%"] EQU [""] (
rem detect Java 8 or 11
IF "%JAVA_VERSION%" == "8" (
java -d64 -version >nul 2>&1
echo Maximum memory allocation pool = %MAX_HEAP_SIZE%, initial memory allocation pool = %HEAP_NEWSIZE%
set IOTDB_HEAP_OPTS=-Xmx%MAX_HEAP_SIZE% -Xms%HEAP_NEWSIZE% -Xloggc:"%IOTDB_HOME%\gc.log" -XX:+PrintGCDateStamps -XX:+PrintGCDetails
goto end_config_setting
) ELSE (
@@ -106,7 +105,6 @@ for /f "tokens=1-3" %%j in ('java -version 2^>^&1') do (
@REM maximum direct memory size
set MAX_DIRECT_MEMORY_SIZE=%MAX_HEAP_SIZE%

echo Maximum memory allocation pool = %MAX_HEAP_SIZE%, initial memory allocation pool = %HEAP_NEWSIZE%
set IOTDB_HEAP_OPTS=-Xmx%MAX_HEAP_SIZE% -Xms%HEAP_NEWSIZE% -Xloggc:"%IOTDB_HOME%\gc.log" -XX:+PrintGCDateStamps -XX:+PrintGCDetails
set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -XX:MaxDirectMemorySize=%MAX_DIRECT_MEMORY_SIZE%

@@ -124,7 +122,9 @@ IF "%1" equ "printgc" (
set IOTDB_HEAP_OPTS=%IOTDB_HEAP_OPTS% -Xlog:gc=info,heap*=trace,age*=debug,safepoint=info,promotion*=trace:file="%IOTDB_HOME%\logs\gc.log":time,uptime,pid,tid,level:filecount=10,filesize=10485760
)
)
echo If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat).


@REM Maximum heap size
@REM set MAX_HEAP_SIZE=2G
@REM set MAX_HEAP_SIZE=2G
echo If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat).
echo Maximum memory allocation pool = %MAX_HEAP_SIZE%, initial memory allocation pool = %HEAP_NEWSIZE%

0 comments on commit 48328e3

Please sign in to comment.