Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
389 views
in Technique[技术] by (71.8m points)

java - Set OpenJDK JVM Crash Dump Location

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.

question from:https://stackoverflow.com/questions/65933587/set-openjdk-jvm-crash-dump-location

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...