开发者社区 > 云原生 > 正文

为什么在Nacos定义JAVA_OPT=-Xms4g -Xmx4g -Xmn512m结果还是这样?

为什么在Nacos定义了JAVA_OPT=-Xms4g -Xmx4g -Xmn512m 结果还是xmx=1g?image.png + export CUSTOM_SEARCH_NAMES=application + CUSTOM_SEARCH_NAMES=application + export CUSTOM_SEARCH_LOCATIONS=file:/home/nacos/conf/ + CUSTOM_SEARCH_LOCATIONS=file:/home/nacos/conf/ + export MEMBER_LIST= + MEMBER_LIST= + PLUGINS_DIR=/home/nacos/plugins/peer-finder + [[ cluster == \s\t\a\n\d\a\l\o\n\e ]] + [[ '' == \e\m\b\e\d\d\e\d ]] + JAVA_OPT='-Xms4g -Xmx4g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m' + [[ n == \y ]] + JAVA_OPT='-Xms4g -Xmx4g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/nacos/logs/java_heapdump.hprof' + JAVA_OPT='-Xms4g -Xmx4g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/nacos/logs/java_heapdump.hprof -XX:-UseLargePages' + print_servers + [[ ! -d /home/nacos/plugins/peer-finder ]] + echo '' + for server in ${NACOS_SERVERS} + echo cmdc-nacos-0.cmdc-nacos.default.svc.cluster.local:8848,cmdc-nacos-1.cmdc-nacos.default.svc.cluster.local:8848,cmdc-nacos-2.cmdc-nacos.default.svc.cluster.local:8848 + [[ all == \c\o\n\f\i\g ]] + [[ all == \n\a\m\i\n\g ]] + [[ ! -z '' ]] + [[ ! -z '' ]] + [[ ! -z '' ]] + [[ ! -z '' ]] + [[ ! -z '' ]] + [[ hostname == \h\o\s\t\n\a\m\e ]] + JAVA_OPT='-Xms4g -Xmx4g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Dnacos.preferHostnameOverIp=true' + JAVA_OPT='-Xms4g -Xmx4g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Dnacos.preferHostnameOverIp=true -Dnacos.member.list=' ++ /usr/local/openjdk-8/bin/java -version ++ sed -E -n 's/.* version "([0-9]).$/\1/p' + JAVA_MAJOR_VERSION=1 + [[ 1 -ge 9 ]] + JAVA_OPT_EXT_FIX=-Djava.ext.dirs=/usr/local/openjdk-8/jre/lib/ext:/usr/local/openjdk-8/lib/ext + JAVA_OPT='-Xms4g -Xmx4g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -server -Xms1g -Xmx1g -Xmn512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/nacos/logs/java_heapdump.hprof -XX:-UseLargePages -Dnacos.preferHostnameOverIp=true -Dnacos.member.list= -Xloggc:/home/nacos/logs/nacos_gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSi

展开
收起
三分钟热度的鱼 2023-05-29 13:49:22 128 0
1 条回答
写回答
取消 提交回答
  • 你变量用错了,JAVA_OPTS。此回答整理自钉群“Nacos社区群3”

    2023-05-29 13:58:14
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载