- 在catalina.bat加入监控
rem ----- Execute The Requested Command ---------------------------------------
echo Using JAVA_OPTS before: “%JAVA_OPTS%”
set JAVA_OPTS=%JAVA_OPTS% -Xms64m -Xmx256m -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\Test\Testheapdump -Xloggc:…/logs/tomcat_gc.log
echo Using JAVA_OPTS after: “%JAVA_OPTS%”
echo Using CATALINA_BASE: “%CATALINA_BASE%”
- 或者在catalina.sh加入监控
#----- Execute The Requested Command -----------------------------------------
JAVA_OPTS="$JAVA_OPTS -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\heapdump"
mat 分析:https://blog.csdn.net/shenzhen206/article/details/54632403