jvm如何配置GC日志?
解决方法:
在tomcat的jvm配置中添加以下红色属性
JAVA_OPTS="-Xmx4g -Xms4g -Xmn1g -XX:PermSize=128m -XX:MaxPermSize=128m -XX:SurvivorRatio=1 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:+CMSClassUnloadingEnabled -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=76 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+PrintClassHistogram -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -Xloggc:../logs/gc.log"
重新启动tomcat就可以到tomcat的logs目录下看到gc.log日志了。
本文链接:http://www.yayihouse.com/yayishuwu/chapter/1624