gc 辅助打印信息

时间:2023-03-09 02:46:06
gc 辅助打印信息

cat xx.xml|grep GC
<jvm-arg>-XX:+PrintGCDetails</jvm-arg>
<jvm-arg>-XX:+PrintGCDateStamps</jvm-arg>
<jvm-arg>-XX:+PrintGCApplicationConcurrentTime</jvm-arg>
<jvm-arg>-XX:+PrintGCApplicationStoppedTime</jvm-arg>

辅助信息

JVM提供了大量命令行参数,打印信息,供调试使用.主要有以下一些:

-XX:+PrintGC

输出形式:[GC 118250K->113543K(130112K), 0.0094143
secs]

[Full GC 121376K->10414K(130112K), 0.0650971 secs]



-XX:+PrintGCDetails

输出形式:[GC [DefNew: 8614K->781K(9088K), 0.0123035
secs] 118250K->113543K(130112K), 0.0124633 secs]

[GC [DefNew: 8614K->8614K(9088K), 0.0000665 secs][Tenured:
112761K->10414K(121024K), 0.0433488 secs] 121376K->10414K(130112K),
0.0436268 secs]



-XX:+PrintGCTimeStamps -XX:+PrintGC:PrintGCTimeStamps可与上面两个混合使用

输出形式:11.851: [GC 98328K->93620K(130112K),
0.0082960 secs]



-XX:+PrintGCApplicationConcurrentTime:打印每次垃圾回收前,程序未中断的执行时间.可与上面混合使用

输出形式:Application time: 0.5291524 seconds



-XX:+PrintGCApplicationStoppedTime:打印垃圾回收期间程序暂停的时间.可与上面混合使用

输出形式:Total time for which application threads were
stopped: 0.0468229 seconds

XX:+PrintTenuringDistribution 查看每次minor GC后新的存活周期的阈值  

Desired survivor size 1048576 bytes, new threshold 7 (max 15)
new threshold 7即标识新的存活周期的阈值为7。

http://www.cnblogs.com/redcreen/archive/2011/05/04/2037057.html