magrokosmos

Tuesday, August 22, 2006

Heap Dump Analysis

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.

0 Comments:

Post a Comment

<< Home