views:

3692

answers:

1

I was told I can add the -XX:+HeapDumpOnOutOfMemoryError parameter to my JVM start up options to my JBoss start up script to get a heap dump when we get an out of memory error in our application. I was wondering where this data gets dumped? Is it just to the console, or to some log file? If it's just to the console, what if I'm not logged into the unix server through the console?

Thanks

+6  A: 

Hi EdC. Here's what Sun's documentation has to say:

By default the heap dump is created in a file called java_pidpid.hprof in the working directory of the VM, as in the example above. You can specify an alternative file name or directory with the -XX:HeapDumpPath= option. For example -XX:HeapDumpPath=/disk2/dumps will cause the heap dump to be generated in the /disk2/dumps directory.

Matt Solnit
This also lists out all VM performance related options: http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp#PerformanceTuning
Ravi Gupta