In Welcome to my new Netweaver performance blog I talked briefly about the new heap dump feature in
JDK 1.4.2_12 (should also be available in the last JDK 1.5 release, but I have not yet checked this).
First a disclaimer,
I’ve not yet seen
an official support statement from Sun for this feature. So
use it at your own risk !
Today I will
give you more information about how to use it with a Netweaver 04(s)
application server. As I mentioned before there is not only an option
to trigger a heap dump on an out of memory situation (-XX:HeapDumpOnOutOfMemoryError)
+but also one to trigger a dump manually. The option
is -XX:+HeapDumpOnCtrlBreak and allows you to trigger a heap
dump using the CtrlBreak key combination. This is useful for triggering
a heap dump of any java application that is running in a console
windows (at least on windows), but it also means that you can trigger a
heap dump easily from your SAP Management Console using the thread dump
This works, because essentially a
thread dump is triggered by the same signal as the heap dump and as
soon as you have configured
-XX:+HeapDumpOnCtrlBreak you will just get a thread and a heap dump.
Heap dumps are written by default in the application’s working
directory The easiest way to get Jhat is to goto http://java.sun.com/javase/6/download.jsp
and download the JDK 1.6 beta.
More information about jhat can be found on Suns JDK 1.6 web site.
aware that for large heap dumps of several hundred Mbytes,jhat will need lot’s of memory. I’m speaking
about Gigabytes, so you will need a 64 bit machine
and operating system.
There’s at least one
commercial profiler (http://www.yourkit.com/)
that also supports reading in this .hprof files. It requires less
memory and has more features than jhat.
Update: Check Olivers blog about the new SAP VM features at The SAP Java VM – What’s in it for me?.
I can add that the SAP VM also supports the new heap dump feature.
One more update:
HP now also supports the new heap dump feature starting with JDK 1.4.2_11 and JDK 5.0.05.
Get it from here