Is it possible to specify where JVM#39;s crash dumps go?(是否可以指定 JVM 的故障转储去哪里?)
问题描述
我们有一个使用 JNI 的桌面应用程序,它偶尔会导致 JVM 崩溃.幸运的是,JVM 生成了一个 hs_err_pidXXXX.log
文件,该文件在调试此类错误时非常有用.但是,它似乎总是进入当前工作目录,从那里挖掘它很烦人,因为我们的其他日志文件都转到特定的日志文件位置".
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?
推荐答案
Joonas,
虽然 HeapDumpPath 适用于堆转储,但它不是您问题的答案.堆转储和 jvm 崩溃日志是两个不同的东西.
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.
要更改 jvm 崩溃日志的目的地,请使用此选项运行 java:
To change the destination of the jvm crash log run java with this option:
-XX:ErrorFile=/path/to/file.
Path/to/file 是您希望 JVM 崩溃日志输出的位置.
Path/to/file is the place you want the JVM crash log to output.
这篇关于是否可以指定 JVM 的故障转储去哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:是否可以指定 JVM 的故障转储去哪里?


- Java包名称中单词分隔符的约定是什么? 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01