Taking manual heapdumps in Solaris JVM 1.4.2 version
Good afternoon all,
I am trying to find a way to take manual heap dumps in jvm 1.4.2 version in Solaris 10 environment. The sun jdk is used by websphere application server and IBM recommends to use sun recommended method to take manual heapdumps. I have searched all over the net and didn't find specific instructions. Anybody has input on this ?
ps: I tried jmap and it created heap dump for small program but for application server instance it is hanging. How long do i need to wait ?
Thanks,
Raja
# 1
In 1.4.2 you can use the -XX:+HeapDumpOnOutOfMemoryError option to tell the VM to generate a heap dump if OutOfMemoryError is thrown. Another way is to run the application with the HPROF agent or other profiler. Recent 1.4.2 updates have an undocumented/unsupported option to generate a heap dump when ctrl-\ (SIGQUIT).
The jmap utility on Solaris can be used to recover a heap dump from a core file or hung process. This is mostly for post mortem diagnostics and there is no guarantee that the heap dump will be readable. As it attaches to the target process via /proc it can take a long time to read the process memory.
Recent releases (jdk6) have most improvements in this area (like jmap -dump which allows you to take a snapshot of the heap at any time).