catalina.sh中修改:
JAVA_OPTS="-server -Xms512m -Xmx4096m -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../logs/serverDump.hprof -XX:ErrorFile=../logs/hs_err_pid.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:../logs/gc.log"
-XX:+UseParallelGC
-XX:+UseG1GC(G1最新的,性能最好)
-XX:+UseConcMarkSweepGC(需要jdk8,小版本173以下)
参考:
https://www.jianshu.com/p/14e84ba9cfd4
参考:
gc日志查看
参考:
https://www.cnblogs.com/qlqwjy/p/7929414.html