views:

9264

answers:

8

I'm looking for a tool or a script that will take the console log from my web app, parse out the garbage collection information and display it in a meaningful way.

I'm starting up on a Sun Java 1.4.2 JVM with the following flags:

-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails

The log output looks like this:

54.736: [Full GC 54.737: [Tenured: 172798K->18092K(174784K), 2.3792658 secs] 257598K->18092K(259584K), [Perm : 20476K->20476K(20480K)], 2.4715398 secs]

Making sense of a few hundred of these kinds of log entries would be much easier if I had a tool that would visually graph garbage collection trends.

+1  A: 

How about trying out some profiling tool like JProbe Freeware (Eclipse plug-in).

Petteri Hietavirta
+1  A: 

jconsole can help you a lot, but I think it's Java 5 and later only. Once I heard someone of SUN speaking at our university and he said that Java 6's garbage collector is A LOT better than the old ones which needed complicated tuning nearly all the time for big applications. Java 6 GC seems to scale a lot better on SMPs.

Johannes Weiß
+5  A: 

I use YourKit java profiler, which lets you measure this sort of thing, and much more, but using it's own format rather than analysing the log. It can do more under Java 5, but should work under 1.4.

Nick Fortescue
+2  A: 

Try VisualGC from Sun. There are JDK 4 and 5 versions that give you a nice visual of what's going on in the eden, generational, and perm spaces. You need to add a JAR and get a PID and Bob's your uncle.

duffymo
+2  A: 

Even better than jconsole is visualvm, which is developed and distributed freely by Sun. It has a GC analyzing plugin called gchisto which might help you.

Edit: Sorry, I didn't see your JDK 1.4.2 requirement. In that case visualvm won't help you, alas.

fred-o
GC Histo is good. But they should also add the heap size to analysis.
Shashikant Kore
+3  A: 

IBM's GC toolkit does exactly what you ask. Here's an article describing what it is and how to use it:

http://www.ibm.com/developerworks/java/library/j-ibmtools2/index.html

I'm not sure if it's compatible with GC logs from Sun's JVM though.

bajafresh4life
This one is not perfect, but it does what I need it to do. It seems to be geared towards the IBM JDK, but it mostly works with the java GC log format. There are a couple of bits of information that don't get parsed out, but most of the data is there.Thanks!
braveterry
+4  A: 

gcviewer does what you want.

kohlerm
+2  A: 

I think some people are adding Java probes which don't really parse garbage collection logs as the question states...

I've tried others (gcviewer, gchisto, IBM's) and the best tool I found for analyzing GC logs is HPjmeter

It is mainly for HP-UX JVMs, but it also usually works with Sun JVMs and does a great job.

alt text

antispam