I'm trying to analyze GC behaviour for our application (running in Tomcat, under Sun's Hotspots, JVM 1.6).
So far I've Instructed the JVM to emit GC logs to a separate file using...
-Xloggc:gc.log
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintGCApplicationConcurrentTime
-XX:+PrintGC
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails
...and used jstat to output logs using...
jstat -gc -t 29045 5s > jstat.gc
I am seeing interesting information, but haven't found a tool to help me analyze/visualize these logs. I was pointed to GCViewer by this question, but it only parses a few log lines from gc.log and then crashes with an exception. Is there a better or more up-to-date tool for parsing these specific logs, for the specific JVM I'm using?
Here is a $0.00 log scraper good for 1.5 CMS collector which gives you a high level view of GC pauses.
You may need to change positional parameter $7 argument to the timestamp function in order to match your log line syntax (my .out gets "enhanced" by Tanuki Wrapper).
gcviewer
hasn't been updated in a number of years, so it's hit or miss - some gc files will work fine, others get exceptions.IBM's gc log parser works acceptably, http://www.alphaworks.ibm.com/tech/pmat/faq
Sun has something called GCPortal, but it requires:
gchisto
has died, there's no longer anything in the project.HPJmeter doesn't understand IBM gc files.
The tools available in the IBM Support Assistant do a pretty good job.
I personally use HP JMeter for a lot of GC visualization. it works "ok" on SUN JRE's, and exceptionally well on HP's JRE (go figure).
With Sun HotSpot 1.6 (on non-HP platforms), I use these GC Options to produce the logs for analysis:
Have you looked at jvisualvm? Comes with the latest JDK, and allows you to watch the JVM. Sample output (using the visualGC plugin). Sample output - alt text http://g4u0420c.houston.hp.com/en/5992-4687/img/visualgc_2.png
Try using gchisto (gchisto.dev.java.net). It can understand the GC log output (I am not sure whether it has been updated to work with the G1 GC). You have to get the sources from CVS (you need a dev.java.net account for that) and build this yourself