views:

321

answers:

1

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?

+4  A: 

By default the heap dump is created in a file called java_pidpid.hprof in the working directory of the VM. 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.

Schildmeijer
Thanks, HeapDumpPath seems to be the correct keyword here.
Joonas Pulakka