4
votes

I'm using OpenJDK 8 and I'm trying to figure out a way to set the JVM binary dump location. This is the output of my java -version: openjdk version "1.8.0_232" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)

When a crash occurs in native code, the JVM generates 2 files in the current directory - text file - relatively small file with call stacks binary mdmp file - large dump file

I was able to set the location of the text file using this flag - -XX:ErrorFile

however any attempt to set the location of the binary file failed I tries with - -XX:HeapDumpPath but it didn't work. The JVM accepted this flag but didn't write the dump in the right location.

1
Did you check xx:HeapDumpPath option? docs.oracle.com/en/java/javase/11/troubleshoot/…Andrzej Sydor

1 Answers

2
votes

Since you have mentioned "mdmp", I assume you are on Windows.

Currently it's not possible to change the default location of JVM minidumps on Windows. It is hard-coded to be the current process directory. So, the workaround is to start Java from a different directory.

The issue JDK-8021940 and the corresponding email thread are exactly about this problem. Unforunately, the issue has been closed as "Won't Fix", but you may try to revive the question on the mailing list.