我的JVM崩溃,生成的hs_err_pid文件中的堆栈跟踪指向某个方法。现在,我看到同样的方法也存在于名为"编译事件"的下部子部分(在处理部分下)中。
以下是来自hs_err_pid文件的相关打印件。请参阅两个部分的 computePath 0x00007f07d4434960 。
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f07d44359f6, pid=1, tid=0x00007f07acc30700
#
# JRE version: OpenJDK Runtime Environment (8.0_151-b12) (build 1.8.0_151-8u151-b12-1~deb9u1-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.151-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# J 17451 C2 com.mycompany.myproject.pf.service.PathComputationServiceBean.computePath(Lorg/jgrapht/GraphPath;)Lcom/mycompany/myproject/pf/model/ComputedPath; (972 bytes) @ 0x00007f07d44359f6 [0x00007f07d4434960+0x1096]
#
# Core dump written. Default location: /application/core or core.1
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
.
.
.
Compilation events (10 events):
Event: 77730.233 Thread 0x00007f07e018f000 17446 3 sun.net.www.http.KeepAliveCache$1::run (5 bytes)
Event: 77730.234 Thread 0x00007f07e018f000 nmethod 17446 0x00007f07d3c53010 code [0x00007f07d3c53180, 0x00007f07d3c53328]
Event: 77731.883 Thread 0x00007f07e018d800 17448 ! 4 java.util.concurrent.ThreadPoolExecutor::getTask (179 bytes)
Event: 77731.890 Thread 0x00007f07e018d800 nmethod 17448 0x00007f07d3c47a10 code [0x00007f07d3c47be0, 0x00007f07d3c48210]
Event: 77901.463 Thread 0x00007f07e018f000 17449 3 sun.net.www.http.ClientVector::<init> (10 bytes)
Event: 77901.464 Thread 0x00007f07e018f000 nmethod 17449 0x00007f07d1976e90 code [0x00007f07d1977020, 0x00007f07d19772e8]
Event: 77963.888 Thread 0x00007f07e018f000 17450 3 sun.net.www.http.KeepAliveCache$1::<init> (15 bytes)
Event: 77963.888 Thread 0x00007f07e018f000 nmethod 17450 0x00007f07d1fbde50 code [0x00007f07d1fbdfc0, 0x00007f07d1fbe1b0]
Event: 78214.567 Thread 0x00007f07e018d800 17451 4 com.mycompany.myproject.pf.service.PathComputationServiceBean::computePath (972 bytes)
Event: 78214.857 Thread 0x00007f07e018d800 nmethod 17451 0x00007f07d44340d0 code [0x00007f07d4434960, 0x00007f07d44400a8]
答案 0 :(得分:1)
“编译事件”显示最近从Java字节码到本机代码编译的方法。如果您始终在同一方法中看到崩溃,这可能意味着您当前使用的JVM版本正在错误地编译此方法。
如果发生任何本机崩溃,您首先需要将JVM升级到最新版本。如果这没有帮助,您可以尝试重写有问题的方法(简化其逻辑,将其分解为更小的方法等),这可以帮助避免崩溃。
答案 1 :(得分:1)
如果它以相同的方法重复崩溃,并且没有永远不会下载的JVM版本,则可以从编译中排除该方法。
请参阅“5.2.1在HotSpot编译器线程或编译代码中解决崩溃” https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/crashes002.html