Generate multiple gnuplot graphs from java gc log data
Generate multiple gnuplot graphs from java gc log data
This visualizer worked great for very old java versions, but has not been kept up-to-date for newer versions. As HubSpot is mostly running newer (jdk11/17) versions, we will not be maintaining this anymore.
We've tried out and had good luck with https://github.com/krzysztofslusarski/jvm-gc-logs-analyzer, which supports newer log formats and also has many different helpful views.
Old Readme contents
The python script gc_log_visualizer.py will use gnuplot to graph interesting characteristics
and data from the given gc log.
InitiatingHeapOccupancyPercent if found.InitiatingHeapOccupancyPercent if found. Reclaimable (mb) amount per mixed gc event.The shell script regionsize_vs_objectsize.sh will take a gc.log
as input and return the percent of Humongous Objects that would fit
into various G1RegionSize's (2mb-32mb by powers of 2).
./regionsize_vs_objectsize.sh
1986 humongous objects referenced in
32% would not be humongous with a 2mb g1 region size
77% would not be humongous with a 4mb g1 region size
100% would not be humongous with a 8mb g1 region size
100% would not be humongous with a 16mb g1 region size
100% would not be humongous with a 32mb g1 region sizeThe start and end dates are optional and can be any format gnuplot understands. The second argument will be used as the base name for the created png files.
python gc_log_visualizer.py
python gc_log_visualizer.py gc.log
python gc_log_visualizer.py gc.log.0.current user-app
python gc_log_visualizer.py gc.log 3minwindow 2015-08-12:19:36:00 2015-08-12:19:39:00The script has been run on ParallelGC and G1GC logs. There may be some oddities/issues with ParallelGC as profiling it hasn't proven overly useful.
The following gc params are required for full functionality.
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicyThe python libs that are required can be found in the setup.py and handled in the usual manner.
# enter a virtualenv or not
pip install -r requirements.txtThe gc.log is parsed into flat files which are then run through gnuplot.
# osx
brew install gnuplot
brew unlink libjpeg
brew install libjpeg
brew link libjpegLine charts of generation sizes and total, bar for InitiatingHeapOccupancyPercent (in Mb), reclaimable amount per mixed gc event.
Another example of the same chart but with the InitiatingHeapOccupancyPercent
set below working set, which results in lots of mixed gc events shown as the reclaimable squares.
To-space exhaustion from traffic bursts on cache expiration events. Solution: use stampeding herd protection.
This visualization of humongous objects shows the sizes in KB, as well as the vertical groupings that have the potential to cause to-space exhaustion.
No open issues yet, or sync has not completed.