From 144c1819b0a9e2607a809d4c45c33dfcfda16097 Mon Sep 17 00:00:00 2001 From: lidaoyang Date: Wed, 8 Jul 2020 09:20:26 +0800 Subject: [PATCH] =?UTF-8?q?Optimize=20=20startup.cmd=EF=BC=8C=20fix=20#326?= =?UTF-8?q?9=20=20(#3270)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #3269 * Fix #3269 --- distribution/bin/startup.cmd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/distribution/bin/startup.cmd b/distribution/bin/startup.cmd index aad58e01e1d..2df9905f0c1 100755 --- a/distribution/bin/startup.cmd +++ b/distribution/bin/startup.cmd @@ -30,6 +30,8 @@ set SERVER=nacos-server set MODE_INDEX=-1 set FUNCTION_MODE_INDEX=-1 set SERVER_INDEX=-1 +set EMBEDDED_STORAGE_INDEX=-1 +set EMBEDDED_STORAGE="" set i=0 @@ -37,6 +39,7 @@ for %%a in (%*) do ( if "%%a" == "-m" ( set /a MODE_INDEX=!i!+1 ) if "%%a" == "-f" ( set /a FUNCTION_MODE_INDEX=!i!+1 ) if "%%a" == "-s" ( set /a SERVER_INDEX=!i!+1 ) + if "%%a" == "-p" ( set /a EMBEDDED_STORAGE_INDEX=!i!+1 ) set /a i+=1 ) @@ -45,6 +48,7 @@ for %%a in (%*) do ( if %MODE_INDEX% == !i! ( set MODE="%%a" ) if %FUNCTION_MODE_INDEX% == !i! ( set FUNCTION_MODE="%%a" ) if %SERVER_INDEX% == !i! (set SERVER="%%a") + if %EMBEDDED_STORAGE_INDEX% == !i! (set EMBEDDED_STORAGE="%%a") set /a i+=1 ) @@ -52,6 +56,9 @@ if %MODE% == "standalone" ( set "JAVA_OPT=%JAVA_OPT% -Xms512m -Xmx512m -Xmn256m" set "JAVA_OPT=%JAVA_OPT% -Dnacos.standalone=true" ) else ( + if %EMBEDDED_STORAGE% == "embedded" ( + set "JAVA_OPT=%JAVA_OPT% -DembeddedStorage=true" + ) set "JAVA_OPT=%JAVA_OPT% -server -Xms2g -Xmx2g -Xmn1g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m" set "JAVA_OPT=%JAVA_OPT% -XX:-OmitStackTraceInFastThrow XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%BASE_DIR%\logs\java_heapdump.hprof" set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages"