1.在TOMCATHOME/bin/catalina.sh开始添加:
JAVA_OPTS=“$JAVA_OPTS -server -Xms768m -Xmx1024m -XX:PermSize=128M -XX:MaxPermSize=256m”
JAVA_OPTS=“$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/21520.hprof”
远程调试端口 21525 线上请不要添加调试功能
CATALINA_OPTS=“-server -Xdebug -Xnoagent -Djava.compiler=NONE-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=21525”
远程监控端口 21526CATALINA_OPTS=“$CATALINA_OPTS -Djava.rmi.server.hostname=localhost -Dcom.sun.management.jmxremote.port=21526 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false”;
===tomcat 静态资源处理====(可用nginx替换)
<Context docBase="D:\A\oceanus-wm\oceanus-wm-web\target\oceanus-wm-web" path="/"/> <Context docBase="D:\A\static\html" path="/static"/> <Context docBase="D:\A\static\image" path="/image"/> </Host> </Engine>
tomcat的优化和远程调试端口添加
时间: 2024-10-14 15:12:34