chewiebug / GCViewer

Fork of tagtraum industries' GCViewer. Tagtraum stopped development in 2008, I aim to improve support for Sun's / Oracle's java 1.6+ garbage collector logs (including G1 collector)
https://github.com/chewiebug/GCViewer/wiki
Other
4.46k stars 976 forks source link

Parse OpenJDK class histograms in the GC log files #183

Open rillig-nm opened 7 years ago

rillig-nm commented 7 years ago

When an OpenJDK VM is started with --XX:+PrintClassHistogramBeforeFullGC or -XX:+PrintClassHistogramAfterFullGC, the GC log contains many lines of class histograms.

The parser currently cannot parse them, which leads to a lot of parse errors.

The class histograms look like this:

193.647: [GC (Allocation Failure)  311936K->299240K(544128K), 0.0032713 secs]

 num     #instances         #bytes  class name
----------------------------------------------
   1:         89311      107489032  [Ljava.lang.Object;
   2:        287706       26877656  [C
...
17799:             1             16  sun.util.resources.LocaleData
17800:             1             16  sun.util.resources.LocaleData$LocaleDataResourceBundleControl
17801:             1             16  yaml.AppEngineYamlCompletionContributor
Total       4273598      302566696
193.913: [Full GC (Allocation Failure)  299240K->239109K(544128K), 0.6366351 secs]
chewiebug commented 7 years ago

The printClassHistogram options look like very verbose debug options, which usually make parsing of the file quite difficult. I personally have rather little priority on supporting the very verbose options and prefer to start support for jdk 9 logs in the little time I have.

chewiebug commented 7 years ago

looks like a duplicate of #152

rillig-nm commented 7 years ago

It's not an exact duplicate. I only wish the parser would skip the class histograms, while in #152 there is a wish for displaying diffs of histograms. Just skipping them should be pretty easy.