JVM | 性能调优

JVM | 性能调优

生产环境打印GC停顿时间

-XX:+printGCApplicationStoppedTime
如果停顿时间过长,需要考虑代码是不是有大的循环, 无法进入安全点导致GC停顿时间过长问题

Total time for which application threads were stopped: 0.0000306 seconds, Stopping threads took: 0.0000070 seconds

生产环境禁止RMI(remote method invoke)调用System.gc();

  • -XX:+DisableExplictGC : 失效直接调用的gc

生产环境真实配置案例

-Dresin.home=$SERVER_ROOT
-server
-Xmx3000M
-Xms3000M
-Xmn600M
-XX:PermSize=500M
-XX:MaxPermSize=500M
-Xss256K
-XX:+DisableExplicitGC
-XX:SurvivorRatio=1
-XX:+UseConcMarkSweepGC
-XX:+UseParNewGC
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSCompactAtFullCollection
-XX:CMSFullGCsBeforeCompaction=0
-XX:+CMSClassUnloadingEnabled
-XX:LargePageSizeInBytes=128M
-XX:+UseFastAccessorMethods
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=70
-XX:SoftRefLRUPolicyMSPerMB=0
-XX:+PrintClassHistogram
-XX:+PrintGCDetails
-XX:+PrintGCTimeStamps
-XX:+PrintHeapAtGC
-Xloggc:log/gc.log

ID[1]


  1. 12466927

猜你喜欢

转载自www.cnblogs.com/Serenity1994/p/12466927.html