javakaffee

Just another weblog about (web) development technologies like spring, tapestry, jersey, jsf, hibernate and more

August 22, 2006

Heap Dump Analysis

Filed under: development, java — martin.grotzke @ 9:04 am

Until now i used an IBM jdk to track down memory problems. The IBM jdks allow to create heap dumps on OutOfMemoryErrors (or with kill -3) and afterwards analyse them with the HeapAnalyzer. More information on this you find in the IBM Diagnostics Guide. There seemed to be nearly no impact on performance, why i could use this also in production environments (for a short time).

Although, in some cases it’s not possible to use an IBM jdk (e.g. because some sun specific implementation is required).

Now it seems to be possible to do something similar with sun jdks: in this posting on TSS i read that you can start your jvm with -XX:+HeapDumpOnOutOfMemoryError (if it’s >= 1.4.2_12 or 1.5.0_06). The produced heap dump afterwards you would analyse with HAT (Heap Analysis Tool, legacy), or the newer jhat (included in Mustang).

For now i didn’t test this new feature of the sun jvm, i’ll post an update when i’ve done this.

Some links on jhat and the OQL (Object Query Language):
What’s in my Java heap?
Querying Java heap with OQL
Permanent generation analysis with OQL

References:
Alan Bateman: HeapDumpOnOutOfMemoryError option in 5.0u7 and 1.4.2_12.

2 Comments »

  1. Hi,
    You can also trigger a dump on dump.
    More information can be found on my blog at http://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/u/6389

    Regards,
    Markus

    Comment by Markus Kohler — October 24, 2006 @ 2:14 pm

  2. Sorry, I meant “You can also trigger a dump on request”

    Comment by Markus Kohler — October 24, 2006 @ 2:14 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

Powered by WordPress