nacos 启动 报堆内存问题
**
nacos 启动 报堆内存问题
**
“nacos is starting with cluster”
Error occurred during initialization of VM
Could not reserve enough space for object heap
1、打开 …/nacos/bin/ startup.cmd 修改以下项( nacos1.x 版本,如:nacos-1.1.3 )
把 set "JAVA_OPT=%JAVA_OPT% -server -Xms2g -Xmx2g -Xmn1g
更改为:set "JAVA_OPT=%JAVA_OPT% -server -Xms512m -Xmx512m -Xmn256m
如:
if %MODE% == “standalone” (
set “JAVA_OPT=%JAVA_OPT% -Xms512m -Xmx512m -Xmn256m”
set “JAVA_OPT=%JAVA_OPT% -Dnacos.standalone=true”
) else (
set “JAVA_OPT=%JAVA_OPT% -server -Xms512m -Xmx512m -Xmn256m -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”
)
2、打开 …/nacos/bin/ startup.cmd 修改以下项( nacos2.x 版本,如:nacos-2.2.2 )
把 set "NACOS_JVM_OPTS=-server -Xms2g -Xmx2g -Xmn1g
更改为 set "NACOS_JVM_OPTS=-server -Xms512m -Xmx512m -Xmn256m
如:
rem if nacos startup mode is cluster
if %MODE% == “cluster” (
echo “nacos is starting with cluster”
if %EMBEDDED_STORAGE% == “embedded” (
set “NACOS_OPTS=-DembeddedStorage=true”
)
set "NACOS_JVM_OPTS=-server -Xms512m -Xmx512m -Xmn256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%BASE_DIR%\logs\java_heapdump.hprof -XX:-UseLargePages"
)
更多推荐
所有评论(0)