I have configured java to dump garbage collection information into the logs (verbose GC). I am unsure of what the garbage collection entries in the logs mean. A sample of these entries are posted below. I've searched around on Google and have not found solid explanations.
I have some reasonable guesses, but I'm looking for answers which provide strict definitions of what the numbers in the entries mean, backed up by credible sources. An automatic +1 to all answers which cite sun documentation. My questions are:
- What does PSYoungGen refer to? I assume it has something to do with the previous (younger?) generation, but what exactly?
- What is the difference between the second triplet of numbers and the first?
- Why is a name(PSYoungGen) specified for the first triplet of numbers but not the second?
- What does each number (memory size) in the triplet mean. For example in 109884K->14201K(139904K), is the memory before GC 109884k and then it is reduced to 14201K. How is the third number relevant? Why would we require a second set of numbers?
8109.128: [GC [PSYoungGen: 109884K->14201K(139904K)] 691015K->595332K(1119040K), 0.0454530 secs]
8112.111: [GC [PSYoungGen: 126649K->15528K(142336K)] 707780K->605892K(1121472K), 0.0934560 secs]
8112.802: [GC [PSYoungGen: 130344K->3732K(118592K)] 720708K->607895K(1097728K), 0.0682690 secs]
I just wanted to mention that one can get the detailed GC log with the
parameter. Then you see the PSYoungGen or PSPermGen output like in the answer.
Also
-Xloggc:gc.log
seems to generate the same output like-verbose:gc
but you can specify an output file in the first.Example usage:
To visualize the data better you can try gcviewer (a more recent version can be found on github).
Take care to write the parameters correctly, I forgot the "+" and my JBoss would not start up, without any error message!
An example of an associated full GC also shows the collectors used for the old and permanent generations:
Finally, breaking down one line of your example log output:
Most of it is explained in the GC Tuning Guide (which you would do well to read anyway).
I'm not certain why there's a PSYoungGen in yours; did you change the garbage collector?