Java Concurrency - Thread Dump

Java Conceptuel Diagram


A thread dump consists of:

for all Java threads in the virtual machine.

The thread dump does not terminate the application: it continues after the thread information is printed.

Structure / Format

A thread dump output consists of:

Each thread is separated by an empty line. The Java threads are printed first, and these are followed by information on VM internal threads.

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
  • Address range, which gives an estimate of the valid stack region for the thread


"Thread2" prio=10 tid=0x000d7c00 nid=0xb waiting for monitor entry [0xf36ff000..0xf36ff8c0]

Thread stack

thread stack (ie stack trace for a thread)


java.lang.Thread.State: BLOCKED (on object monitor)
        at Deadlock$
        - waiting to lock <0xf819a938> (a java.lang.String)
        - locked <0xf819a970> (a java.lang.String)

Heap Summary

Starting with Java SE 6, the Ctrl-Break handler also prints a heap summary. This output shows the different generations (areas of the heap):

  • with the size,
  • the amount used,
  • and the address range. The address range is especially useful if you are also examining the process with tools such as pmap.
 def new generation   total 1152K, used 435K [0x22960000, 0x22a90000, 0x22e40000
  eden space 1088K,  40% used [0x22960000, 0x229ccd40, 0x22a70000)
  from space 64K,   0% used [0x22a70000, 0x22a70000, 0x22a80000)
  to   space 64K,   0% used [0x22a80000, 0x22a80000, 0x22a90000)
 tenured generation   total 13728K, used 6971K [0x22e40000, 0x23ba8000, 0x269600
   the space 13728K,  50% used [0x22e40000, 0x2350ecb0, 0x2350ee00, 0x23ba8000)
 compacting perm gen  total 12288K, used 1417K [0x26960000, 0x27560000, 0x2a9600
   the space 12288K,  11% used [0x26960000, 0x26ac24f8, 0x26ac2600, 0x27560000)
    ro space 8192K,  62% used [0x2a960000, 0x2ae5ba98, 0x2ae5bc00, 0x2b160000)
    rw space 12288K,  52% used [0x2b160000, 0x2b79e410, 0x2b79e600, 0x2bd60000)

Heap histogram

If the Java VM flag -XX:+PrintClassHistogram is set, then the Ctrl-Break handler will produce a heap histogram.


After printing the thread dump, the HotSpot VM executes a deadlock detection algorithm. If a deadlock is detected it will be printed along with the stack trace of the threads involved in the deadlock.

The default deadlock detection works with locks that are obtained using:

If the Java VM flag -XX:+PrintConcurrentLocks is set, then the stack trace also shows a list of lock owners.


  • The thread main is locking object <0xf0c30560> and is waiting to enter 0xf0c41ec8, which is locked by thread AWT-EventQueue-0.
  • However, thread AWT-EventQueue-0 is waiting to enter 0xf0c30560, which is locked by main.
Found one Java-level deadlock:
  waiting to lock monitor 0x000ffbf8 (object 0xf0c30560, a java.awt.Component$AWTTreeLock),
  which is held by "main"
  waiting to lock monitor 0x000ffe38 (object 0xf0c41ec8, a java.util.Vector),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
        at java.awt.Container.removeNotify(
        - waiting to lock <0xf0c30560> (a java.awt.Component$AWTTreeLock)
        at java.awt.Window$
        at java.awt.Window.doDispose(
        at java.awt.Dialog.doDispose(
        at java.awt.Window.dispose(
        at java.awt.Window.disposeImpl(
        at java.awt.Window$
        - locked <0xf0c41ec8> (a java.util.Vector)
        at java.awt.Window.doDispose(
        at java.awt.Window.getOwnedWindows(
        - waiting to lock <0xf0c41ec8> (a java.util.Vector)
        at javax.swing.SwingUtilities$SharedOwnerFrame.installListeners(
        at javax.swing.SwingUtilities$SharedOwnerFrame.addNotify(
        at java.awt.Dialog.addNotify(
        - locked <0xf0c30560> (a java.awt.Component$AWTTreeLock)
        at java.awt.Dialog.conditionalShow(
        - locked <0xf0c30560> (a java.awt.Component$AWTTreeLock)



with Console

If the application console (standard stream) is available, then to cause the HotSpot VM to print a thread dump, including thread state, press:

  • on Linux: the Ctrl-\ key combination
  • on Windows: the Ctrl-Break key combination

With Process id

  • On Linux, the thread dump can also be obtained by sending a SIGQUIT to the process. command
kill -QUIT <pid>

the thread dump is printed to the standard output of the target process. The output might be directed to a file, depending on how the process was started.

jstack -F pid 
  • See also the demo folder in the Jdk demo/management/FullThreadDump or FullThreadDump. Shows how to get thread dumps and look for deadlocks.


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$
        - 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$
        - 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(
        - locked <0xf4000b40> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(
        at java.lang.ref.Finalizer$

"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(
        at java.lang.ref.Reference$
        - 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

Documentation / Reference

Discover More
Java Conceptuel Diagram
Java - Hang Troobleshooting

procedures for troubleshooting hanging or looping processes. deadlock in application code, API code, or library code. bug in the HotSpot virtual machine. An initial step when diagnosing...
Java Conceptuel Diagram
Java - Thread Stack (Stack Trace)

thread stack (ie stack trace) Jstack A core dump has also the stack trace The -m option of Jstack can be used to print the native frames
Java Conceptuel Diagram
Java Concurrency - Deadlock

deadlock in Java. The Java programming language neither prevents nor requires detection of deadlock conditions. Programs where threads hold (directly or indirectly) locks on multiple objects should...
Thread Java Mission Control
Java Concurrency - Thread

Every application has at least one thread . From the application programmer's point of view, you start with just one thread, called the main thread. From this thread, you can start other threads. ...

Share this page:
Follow us:
Task Runner