Is it possible to specify where JVM's crash dumps go?

Joonas Pulakka picture Joonas Pulakka · Dec 10, 2009 · Viewed 27.3k times · Source

We have a desktop application using JNI that occasionally causes the JVM to crash. Luckily the JVM produces a hs_err_pidXXXX.log file, which is quite useful in debugging such errors. However, it always seems to go to the current working directory, and it's annoying to dig it from there, since our other log files all go to a specific "log file place".

Is it possible to specify different location for those "crash dump" files? How?

Answer

Andrew Carr picture Andrew Carr · May 3, 2012

Joonas,

Although the HeapDumpPath works for the heap dump it is not the answer for your question. The heap dump and the jvm crash log are two separate things.

To change the destination of the jvm crash log run java with this option:

-XX:ErrorFile=/path/to/file.

Path/to/file is the place you want the JVM crash log to output.