GC log analysis for jvm health monitoring

Copy file to shared folder java

There is a nice way to map GC logs to excel sheets without even editing a single bit in excel file. Using below method you will get very pretty graphs in excel for presentation and your own reference. you don’t need to bother about calculating each bit from the GC log and then mapping it to excel. In below script you can directly map the GC data directly to CSV/Excel format.


#!/bin/bash
#Make sure you have a full GC log, broken GC logs won't work. Minimum one Full GC cycle should have been recorded in the log.

GC_LOG=server-myapp-gc.log;
CSV_LOC=/tmp/gclog.csv;

echo “Heap Usage Before, Heap Usage After”>$CSV_LOC;
grep Full server-myapp-gc.log | awk ‘{print $8}’ | awk ‘BEGIN {FS=”K->”};{print $1″ “$2}’ | awk ‘BEGIN {FS=”K”};{print $1}’ | awk ‘{print $1″,”$2}’>>$CSV_LOC

echo "GC log mapping completed, Please copy the $CSV_LOC file and open in excel to view the GC map";

Once all parameters are imported to CSV file, open it in Excel and create a map.
Using the graph you can check whether the application/server performing well or not, or there is a high probability of server JVM crash in few more days.
Usually irregular high GC behavior leads to JVM crash.

Full GC graph

Note: This is not yet tested I am yet to test the script.

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

3 Responses

  1. performancetestexpert says:

    For free gc log analysis, send the log file to [email protected]

  2. Serj says:

    You’d better start using GCPlot (gcplot(dot)com) for such analysis, everything is automated already.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.