GC log analysis for jvm health monitoring
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.
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.
For free gc log analysis, send the log file to [email protected]
You’d better start using GCPlot (gcplot(dot)com) for such analysis, everything is automated already.
Thanks for the suggestion, surely readers will benefit from this. There is also another way to complete GC analysis via eclipse labs Garbage Cat tool. Related article:
http://www.techpaste.com/2011/12/memory-monitoring-bottlenecks-optimization-gc-logs-garbagecat-tool/
FYI: The article was written in year 2011 when manual and garbage cat were the most used, so may be outdated. BTW I see the beta program of GCplot just started in yr 2016 only. 🙂 Though I have not yet tested it but hopefully it will become a main stream GA’ed tool beneficial for developers in coming years.