# Thread dumps

Thread dumps are a tool for examining the state of an application at a particular instant. They provide a list of the threads in the application together with their stack traces, which can be useful in debugging problems, such as deadlocks or unresponsive UI. The main advantage of thread dumps is their plain-text format and multitude of tools that can capture and process them.

IntelliJ IDEA lets you capture thread dumps for running processes as well as interpret external thread dumps taken in IntelliJ IDEA or another tool, such as `jstack` and `jcmd` .

IntelliJ IDEA supports formats produced by JDK tooling up to version 25.

> **Note:**
> The content and format of a thread dump might be different depending on the tool used to capture it. For example, IntelliJ IDEA will dump Kotlin coroutines and Java virtual threads together with their states at the time of capturing, which information might be absent in thread dumps captured by other tools.

Procedure: Capture a thread dump from IntelliJ IDEA

1. While running a program from IntelliJ IDEA: on the  Run  tool window's toolbar, click ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.dump.svg)  Dump Threads  .

![The Dump Threads button on the Run tool window toolbar](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ij_run_dump_threads.png)

2. While debugging a program from IntelliJ IDEA: on the  Debug  tool window's toolbar, click ![More](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.moreVertical.svg)  More  , then select ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.actions.dump.svg)  Get Thread Dump  .

![The More button on the Debug tool window toolbar](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ij_debug_more.png)

3. For any Java/Kotlin process running locally: On the  Home  tab of the  Profiler  tool window, click the process for which you want to create a thread dump. Select  Get Thread Dump  .

![A menu opens on right-clicking a process in the Profiler tool window](https://resources.jetbrains.com.cn/help/img/idea/2026.2/home-tab-thread-dump.png)

> **Note:**
> Capturing virtual threads and Kotlin coroutines is only supported when you take a thread dump for a program launched in debug mode.

Procedure: Open an external thread dump

1. In the main menu, go to `Code | Analyze Stack Trace or Thread Dump`.

2. In the Analyze Stack Trace dialog that opens, paste the  thread dump into the Put a stack trace or a complete thread dump here:   text area.

The thread dump opens in a new tool window tab. This view is customizable: you can apply filters and sorting, merge similar threads, and partially collapse the stack traces.

The icons near thread names indicate the thread's state:

| Icon | Description |
| --- | --- |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.resume.svg)  |  Running/active – the default state, in which a thread is actively executing code  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.debugger.threadRunning.svg)  |  (for Kotlin coroutines) Running – a coroutine is actively executing code  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.run.muteBreakpoints.svg)  |  Sleeping – occurs when a thread is in `Thread.sleep`, or when it is parking or waiting on a condition  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.expui.debugger.threads.svg)  |  Carrier thread – a platform thread that is currently executing a virtual thread, or a coroutine in the [created/unknown](#kotlin_coroutines) state  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.debugger.threadFrozen.png)  |  Waiting – occurs when a thread is waiting on an object monitor, or a coroutine is suspended  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.debugger.threadStates.socket.svg)  |  Socket – occurs when a thread is performing network I/O  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.general.save.svg)  |  I/O – occurs when a thread is performing a non-network I/O operation  |
|  ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.status.success.svg) , ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.actions.profileCPU.png)  |  EDT (Event Dispatch Thread) – the UI thread in Swing applications. ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.status.success.svg) is for idle EDT, and ![](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.actions.profileCPU.png) is for active.  |

Additionally, a wavy overlay indicates virtual threads and Kotlin coroutines, while daemon threads are indicated by a “ghost” overlay:

![The overlays in a thread dump indicating virtual threads and daemon threads](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ij-thread-dump-overlays.png)

Some calls in the Run tool window have a dotted underline. These calls occur inside a `try` block and can throw a checked exception.

If you want to inspect a class that appears in the stack trace, you can navigate to it right from the thread dump.

Procedure: Jump to source

* Click the hyperlink in the stack trace.

![Hyperlinks in a thread dump](https://resources.jetbrains.com.cn/help/img/idea/2026.2/thread-dump-jump-to-source.png)

> **Note:**
> If the line reference does not appear as a hyperlink, it means the source is not available in the project code and dependencies.

If you want to save the thread dump for later inspection or send it to someone else, you can export it as a text file.

Procedure: Export thread dump as a text file

1. On the toolbar, click  Export to Text File  .

![The 'Export to text file' button in thread dump viewer](https://resources.jetbrains.com.cn/help/img/idea/2026.2/export-thread-dump.png)

2. Specify the path and click  Save  .

## IntelliJ IDEA's thread dump format

When viewing IntelliJ IDEA's thread dump in text format, you might notice additional information in the thread descriptions and stack traces.

Here is an example of how it looks like:

```
"main" prio=5 tid=0x000001f3c9d13000 nid=NA runnable
  java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
    at java.net.SocketInputStream.read(SocketInputStream.java:171)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
      - locked <0x00000007ab1d3fa8> (a java.io.InputStreamReader)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
```

Each thread in the dump is represented with the following information:

### Thread header Line

```
"Thread-Name" [state flags] prio=N tid=0xHEXVALUE nid=NA [thread state]
```

Thread header line goes first in every thread description and consists of:

* Thread name in quotes

* Optional flags indicating if a thread is daemon or virtual

* Thread priority (`prio`) – value managed by the JVM that indicates the thread's scheduling priority ranging from 1 (lowest) to 10 (highest). The default value is 5. These priorities may be mapped to OS-level thread priorities, however, the mapping is implementation-dependent, and priorities serve as hints to the scheduler rather than guarantees of execution order.

* Thread ID in hexadecimal (`tid`)

* Native ID (`nid`) – usually `NA` in IDE-generated dumps. This information is typically only available when thread dumps are generated by the JVM itself

* Thread state. The following states are recognized: | Thread state | Description | | --- | --- | | `runnable` | thread is actively running or ready to run | | `sleeping` | thread is in a sleep state (`Thread.sleep()`) | | `waiting on condition` | thread is waiting for a condition | | `waiting for monitor entry` | thread is waiting to acquire a monitor lock | | `sleeping` | thread is in a sleep state (`Thread.sleep()`) | | `parking` | thread is parked (`LockSupport.park()`) | | `on object monitor` | thread is waiting on an object monitor | | `idle` | event dispatch thread is in an idle state |

### Thread state line

Thread state line goes right after the thread header line and contains the thread's state as indicated by the JVM. The following states are possible:

| Thread state | Description |
| --- | --- |
| `NEW` | a thread that has not yet started execution |
| `RUNNABLE` | a thread executing in the Java virtual machine |
| `BLOCKED` | a thread blocked waiting for a monitor lock |
| `WAITING` | a thread waiting indefinitely for another thread to perform a particular action |
| `TIMED_WAITING` | a thread waiting for another thread to perform an action for up to a specified waiting time |
| `TERMINATED` | a thread that has finished execution |

For more information on thread states, refer to [official Java documentation](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Thread.State.html).

### Stack trace

The stack trace shows the sequence of method calls for the thread, characterized by the following:

* Each line in the stack trace begins with a tab character.

* Method calls are listed from top (recent/called methods) to bottom (earlier/calling methods).

* Each line follows the format: `at package.class.method(SourceFile:LineNumber)`. When IntelliJ IDEA recognizes the source file, you can use it to [navigate to the source code](#jump-to-source).

### Lock information

When available, IntelliJ IDEA's thread dumps provide information about locks held by the thread, including:

* Monitors owned by this thread

* Threads blocked by this thread

* Monitors this thread is waiting for

* Lock objects with their class and memory address

### Kotlin coroutines

You can view Kotlin coroutines in IntelliJ IDEA's thread dumps alongside Java threads. For example:

```
"coroutine:2" SUSPENDED
    at kotlinx.coroutines.DelayKt.awaitCancellation(Delay.kt:157)
    at NetworkServiceKt.fetchData(NetworkService.kt:15)
    at MainKt$main$1.invokeSuspend(Main.kt:11)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
```

The coroutines information is formatted as follows:

```
"CoroutineName:id" (state) [dispatcher]
  <coroutine descriptor>
  <stack trace>
```

* Name and ID: The coroutine name followed by its unique ID, for example, `coroutine:1`

* State: The coroutine's current state, for example, `SUSPENDED`

* Dispatcher: Information about the dispatcher the coroutine is using, for example `Dispatchers.IO`

* Stack trace: The coroutine's stack frames

Coroutines can be in one of the following states:

| Coroutine state | Description |
| --- | --- |
| `RUNNING` | The coroutine is currently executing |
| `SUSPENDED` | The coroutine is suspended at a suspension point |
| `CREATED` | The coroutine has been created but not yet started |
| `UNKNOWN` | The state cannot be determined |

