Tomcat启动参数修改

CATALINA_OPTS="-server -Xms1024M -Xmx4096M -XX:PermSize=128M -XX:MaxPermSize=256M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:HeapDumpPath=$CATALINA_BASE/log/heap.hprof -Dproject=gameserver -Djava.rmi.server.hostname=ip -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=port -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -Xloggc:$CATALINA_BASE/log/gc.log -XX:ErrorFile=$CATALINA_BASE/log/java_error_%p.log -XX:OnError=\"pmap %p\" -XX:OnError=\"gcore %p\" -Xcheck:jni"

1、位置最好在执行前
# ----- Execute The Requested Command -----------------------------------------
这样可以保证里面的属性,如CATALINA_BASE 能正确获得

2、[color=red]不能使用JAVA_OPTS[/color],下面是二者区别
# JAVA_OPTS (Optional) Java runtime options used when any command
# is executed.
# Include here and not in CATALINA_OPTS all options, that
# should be used by Tomcat and also by the stop process,
# the version command etc.
# Most options should go into CATALINA_OPTS.
# CATALINA_OPTS (Optional) Java runtime options used when the "start",
# "run" or "debug" command is executed.
# Include here and not in JAVA_OPTS all options, that should
# only be used by Tomcat itself, not by the stop process,
# the version command etc.
# Examples are heap size, GC logging, JMX ports etc.
使用JAVA_OPTS关服的时候会抛出异常:
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: portNum; nested exception is:
java.net.BindException: Address already in use
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值