Skip to content
Roman edited this page Nov 11, 2015 · 4 revisions

HOWTO generate log

Run llst, a file named gc.log will be created in the current directory. We chose Java format of logs to reduce the number of overengineering.

Where can I get gcviewer?

http://sourceforge.net/projects/gcviewer/

GCViewer posibilities

GCViewer can be launched in GUI (default mode): type java -jar gcviewer.jar and then choose your log file. Or type java -jar gcviewer.jar gc.log to explicitly select file in command line. GUI is useful for runtime tracking metrics (chart+summary) and scale charts.

Also you can type java -jar gcviewer.jar gc.log summary.csv chart.png to obtain the same characteristics statically in files for summary info (comma separated value format) and chart (png). That mode is useful in scripts for automatic testing gc and parsing results.

GCViewer summary information

GCViwer is aimed to work with Java log format, but it can also handle our gc.log! GCViewer has many features to work with generational garbage collectors with 3 generations: young, survived and old. We have implemented basic algorithms so far, that's many metrics are omitted.

Example of csv:

gcLogFile; gc.log; -
footprint; 5,184; K
footprintAfterFullGC; n.a.; M
slopeAfterFullGC; n.a.; M/s
freedMemoryByFullGC; n.a.; M
avgFreedMemoryByFullGC; n.a.; M
avgFreedMemoryByFullGCσ; n.a.; M
avgFreedMemoryByFullGCisSig; n.a.; bool
avgfootprintAfterGC; 1,042.577; K
avgfootprintAfterGCσ; 674.98; K
avgfootprintAfterGCisSig; false; bool
slopeAfterGC; n.a.; M/s
avgRelativePostGCInc; n.a.; M/coll
freedMemoryByGC; 235.171; M

The list of interesting metrics: avgPause, avgPauseσ, throughput, totalTime.

GCViewer chart

The chart presented before again:

summary chart

There abscissa is time of program running (obvious). And there is two ordinates for different lines: memory lines scaled for first odinate and time lines for second.

Metrics imagened on chart:

  • Red background (first ordinate) - total heap size.
  • Blue line - used heap size (statistics are collected before and after collecting).
  • Green line (second ordinate) - time used by gc for collecting.
  • Grey line below meens normal collecting, also possible shows red line for failure, blue for mark event, etc...
  • other lines availbale for concurrent and generational gc

What kind of information you may extract from this chart? For example you can see growing of long-lived objects below blue "bunch", which copying each collection. And you can see size of short-lived set in blue bunch which gying each collection and their relation. Also you can find a linear dependence of the delay on the amount of long-lived objects.