您的位置:首页 > 其它

The best way to check the GC status

2013-09-12 10:56 399 查看
$ jstat -gcutil 21719 1s

S0    S1    E    O    P    YGC    YGCT    FGC    FGCT GCT

48.66 0.00 48.10 49.70 77.45 3428 172.623 3 59.050 231.673

48.66 0.00 48.10 49.70 77.45 3428 172.623 3 59.050 231.673

Here, check the values of YGC and YGCT. Divide YGCT by YGC. Then you get 0.050 seconds (50 ms). It means that it takes average 50 ms to execute GC in the Young area. With that result, you don't need to care about GC for the Young area.

And now, check the values of FGCT and FGC. Divide FGCT by FGC. Then you get 19.68 seconds. It means that it takes average 19.68 seconds to execute GC. It may take 19.68 seconds to execute GC three times. Otherwise, it takes 1 second to execute GC two times
and 58 seconds for once. In both cases, GC tuning is required.

You can easily check GC status by using the jstat command; however, the best way to analyze GC is by generating logs with the –verbosegc option. For a detailed description on how to generate and tools to analyze logs, I have explained it the previous article.
HPJMeter is my favorite among tools that are used to analyze the -verbosegc log. It is easy to use and analyze. With HPJmeter you can easily check the distribution of GC execution times and the frequency of GC occurrence.

 

see: http://www.cubrid.org/blog/dev-platform/how-to-tune-java-garbage-collection/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  sun jm gc