gpt4 book ai didi

java - 哪个 JVM 打印出这样的线程转储?

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:28:02 25 4
gpt4 key购买 nike

我习惯于看到如下所示的 Java 线程转储,这是由 Sun HotSpot JVM 及其衍生产品(例如 OpenJDK)生成的线程转储:

"main" prio=10 tid=0x00007f4020009000 nid=0x538c in Object.wait() [0x00007f402891f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000614ea64e8> (a java.lang.Object)
at java.lang.Object.wait(Object.java:503)
at org.eclipse.jetty.util.thread.QueuedThreadPool.join(QueuedThreadPool.java:386)
- locked <0x0000000614ea64e8> (a java.lang.Object)
at org.eclipse.jetty.server.Server.join(Server.java:398)
at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:531)
at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:528)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)

现在,在帮助其他用户使用我的软件时,我偶尔会遇到另一种形式的线程转储,如下所示:

Thread 9255: (state = BLOCKED)
- sun.reflect.annotation.AnnotationType.getInstance(java.lang.Class) @bci=0, line=63 (Interpreted frame)
- sun.reflect.annotation.AnnotationParser.parseAnnotation(java.nio.ByteBuffer, sun.reflect.ConstantPool, java.lang.Class, boolean) @bci=94, line=202 (Interpreted frame)
- sun.reflect.annotation.AnnotationParser.parseAnnotations2(byte[], sun.reflect.ConstantPool, java.lang.Class) @bci=39, line=69 (Compiled frame)
- sun.reflect.annotation.AnnotationParser.parseAnnotations(byte[], sun.reflect.ConstantPool, java.lang.Class) @bci=11, line=52 (Compiled frame)
- java.lang.Class.initAnnotationsIfNecessary() @bci=22, line=3070 (Interpreted frame)
- java.lang.Class.getAnnotation(java.lang.Class) @bci=13, line=3029 (Interpreted frame)
- com.google.inject.internal.Annotations.isRetainedAtRuntime(java.lang.Class) @bci=3, line=57 (Interpreted frame)
- com.google.inject.Key.ensureRetainedAtRuntime(java.lang.Class) @bci=1, line=362 (Interpreted frame)
- com.google.inject.Key.strategyFor(java.lang.annotation.Annotation) @bci=15, line=339 (Interpreted frame)
- com.google.inject.Key.get(com.google.inject.TypeLiteral, java.lang.annotation.Annotation) @bci=6, line=274 (Interpreted frame)
- com.google.inject.assistedinject.FactoryProvider2.assistKey(java.lang.reflect.Method, com.google.inject.Key, com.google.inject.internal.Errors) @bci=14, line=522 (Interpreted frame)
- com.google.inject.assistedinject.FactoryProvider2.<init>(com.google.inject.Key, com.google.inject.assistedinject.BindingCollector) @bci=306, line=235 (Interpreted frame)

如您所见,格式完全不同,而且很差。它不报告它持有的锁,也不报告它正在等待哪个对象。

有谁知道哪种 JavaVM 系列会产生第二种风格的堆栈跟踪?我自己从来没有用过,这已经困扰我一段时间了!

最佳答案

这是使用 -F 选项运行时 jstack(在 Oracle JDK 中)的输出。

关于java - 哪个 JVM 打印出这样的线程转储?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17437473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com