jdk8 的jstack相关资料
官方jstack 信息描述
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr019.html#BABBEFFC
jstack信息示例:
<pre dir="ltr" xml:space="preserve" style="font-family: "Courier New", Monaco, Courier, monospace; color: rgb(68, 68, 68); margin-left: 40px;">Full thread dump Java HotSpot(TM) Client VM (1.6.0-rc-b100 mixed mode):
"DestroyJavaVM" prio=10 tid=0x00030400 nid=0x2 waiting on condition [0x00000000..0xfe77fbf0]
java.lang.Thread.State: RUNNABLE
"Thread2" prio=10 tid=0x000d7c00 nid=0xb waiting for monitor entry [0xf36ff000..0xf36ff8c0]
java.lang.Thread.State: BLOCKED (on object monitor)
at Deadlock$DeadlockMakerThread.run(Deadlock.java:32)
- waiting to lock <0xf819a938> (a java.lang.String)
- locked <0xf819a970> (a java.lang.String)
"Thread1" prio=10 tid=0x000d6c00 nid=0xa waiting for monitor entry [0xf37ff000..0xf37ffbc0]
java.lang.Thread.State: BLOCKED (on object monitor)
at Deadlock$DeadlockMakerThread.run(Deadlock.java:32)
- waiting to lock <0xf819a970> (a java.lang.String)
- locked <0xf819a938> (a java.lang.String)
"Low Memory Detector" daemon prio=10 tid=0x000c7800 nid=0x8 runnable [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
"CompilerThread0" daemon prio=10 tid=0x000c5400 nid=0x7 waiting on condition [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x000c4400 nid=0x6 waiting on condition [0x00000000..0x00000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=10 tid=0x000b2800 nid=0x5 in Object.wait() [0xf3f7f000..0xf3f7f9c0]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0xf4000b40> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked <0xf4000b40> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=10 tid=0x000ae000 nid=0x4 in Object.wait() [0xfe57f000..0xfe57f940]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0xf4000a40> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0xf4000a40> (a java.lang.ref.Reference$Lock)
"VM Thread" prio=10 tid=0x000ab000 nid=0x3 runnable
"VM Periodic Task Thread" prio=10 tid=0x000c8c00 nid=0x9 waiting on condition </pre>
首行信息描述:
The header line contains the following information about the thread:
* Thread name
* Indication if the thread is a daemon thread
* Thread priority (prio)
* Thread ID (tid), which is the address of a thread structure in memory
* ID of the native thread (nid)
* Thread state, which indicates what the thread was doing at the time of the thread dump. See [Table 2-6](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr034.html#BABJFBFI) for more details.
* Address range, which gives an estimate of the valid stack region for the thread
线程状态描述
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr034.html#BABJFBFI
NEW
The thread has not yet started.
RUNNABLE
The thread is executing in the JVM.
BLOCKED
The thread is blocked waiting for a monitor lock.
WAITING
The thread is waiting indefinitely for another thread to perform a particular action.
TIMED_WAITING
The thread is waiting for another thread to perform an action for up to a specified waiting time.
TERMINATED
The thread has exited.