java 如何分析JVM崩溃文件hs_err_pidXYZ.log
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10087032/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to analyze JVM crash file hs_err_pidXYZ.log
提问by redochka
When working on a webapp in Eclipse and Tomcat (wtp) , tomcat crashes and create a file: hs_err_pid20216.log
在 Eclipse 和 Tomcat (wtp) 中处理 webapp 时,tomcat 崩溃并创建一个文件:hs_err_pid20216.log
I tried to use eclipse MAT to analyse the file but MAT doesn't recognize the file as something it can handle, I tried also DAT and it was the same thing. It won't show in the open file dialog.
我尝试使用 eclipse MAT 来分析文件,但 MAT 无法将文件识别为它可以处理的内容,我也尝试了 DAT,结果是一样的。它不会显示在打开文件对话框中。
What kind of file is it?
它是什么类型的文件?
What should I use to analyze it?
我应该用什么来分析它?
Do I have to make changes to this file so that it will be possible for these tools to parse it.
我是否必须对此文件进行更改,以便这些工具可以解析它。
The log file is available as a GitHub gist
日志文件作为GitHub 要点提供
UPDATE:
更新:
See @Dan Cruz reply for more information on how to deal with hs_err_pidXYZ.log file. For curious, the cause of the crash was Hymanson being confused by a cyclic relationship (bidirectional one-to-many) but this is another story...
有关如何处理 hs_err_pidXYZ.log 文件的更多信息,请参阅 @Dan Cruz 回复。出于好奇,崩溃的原因是Hyman逊被循环关系(双向一对多)弄糊涂了,但这是另一个故事......
采纳答案by Dan Cruz
What kind of file it is?
它是什么类型的文件?
It's a HotSpot error log file in text format.
这是一个文本格式的 HotSpot 错误日志文件。
What should I use to analyze it?
我应该用什么来分析它?
Start by downloading the OpenJDK 6 source bundle. Search through the hotspot *.cpp
files for strings in the error log. Review the source files for an explanation of what the error log contains.
首先下载OpenJDK 6 源包。在热点*.cpp
文件中搜索错误日志中的字符串。查看源文件以了解错误日志包含的内容。
For example, using OpenJDK 7 sources, you can find siginfo
(the operating system process signal information) in the os::print_siginfo()
method of os_linux.cpp
, Registers
(the CPU registers' values) in the os::print_context()
method of os_linux_x86.cpp
, etc.
例如,使用OpenJDK 7个的来源,可以发现siginfo
在(操作系统进程信号信息)os::print_siginfo()
的方法os_linux.cpp
,Registers
在(在CPU寄存器值)os::print_context()
的方法os_linux_x86.cpp
等。
Do I have to make changes to this file sothat it will be possible for these tools to parse it.
我是否必须对此文件进行更改,以便这些工具可以解析它。
That would be impossible since the Eclipse Memory Analyzerrequires a heap file, which the HotSpot error log is not.
这是不可能的,因为Eclipse Memory Analyzer需要一个堆文件,而 HotSpot 错误日志则不需要。
回答by Nicolas C
It's a text file. Open it in an editor and try to understand what it means.
这是一个文本文件。在编辑器中打开它并尝试理解它的含义。
回答by epcpu
https://fastthread.iogives a well descriptive analyze on the file. it just need to upload it and it will give following items:
https://fastthread.io对文件进行了很好的描述性分析。它只需要上传它,它将提供以下项目:
- Reason to crash
- Recommended Solutions
- Active Thread (when app crashed)
- Core Dump Location
- All threads
- ...
- 崩溃的原因
- 推荐解决方案
- 活动线程(当应用程序崩溃时)
- 核心转储位置
- 所有线程
- ...