llms.txt: machine-readable documentation index. Markdown version of this page is also available.

IntelliJ IDEA 2026.2 Help

Debug Kotlin coroutines

While coroutines are particularly well suited for asynchronous programming, there is still room for mistakes, which may be hard to figure out due to the challenges that the asynchronous flow poses.

When debugging Kotlin code, IntelliJ IDEA allows you to suspend the execution and diagnose problems that the code in coroutines may have. The debug information is available even if the coroutine is not running at the moment.

Learn more in the Kotlin documentation.

Inspect coroutines

  1. Set a breakpoint in or near the coroutine code.

  2. Start the application in debug mode.

  3. Wait until the application reaches the breakpoint.

  4. In the Debug tool window, select the Coroutines tab from the Layout Settings.

The view groups coroutines by their dispatchers. Expand a dispatcher node to see its coroutines.

Coroutines grouped by dispatcher in the Coroutines tab

For each coroutine, IntelliJ IDEA displays its current state:

  • CREATED: The coroutine is created but is not running.

  • RUNNING: The coroutine is currently executing.

  • SUSPENDED: The coroutine is paused and is not currently executing on a thread.

Where applicable, the view also shows information about the thread on which a coroutine is executing.

Examine a coroutine

In the Coroutines tab, you can see a full coroutine creation stack, as well as a call stack inside the coroutine. The stack includes all frames with variable values, even those that would be lost during standard debugging.

The coroutine creation stack

When debugging coroutines, you can use all the standard functionality of the Variables tab. For more information about using the Variables tab, refer to the Examine/update variables topic.

Variables tab for a coroutine

If you are not interested in calls in Kotlin classes, you can hide them by clicking Hide Frames from Libraries in the top-right corner of the Frames tab.

Hide calls in Kotlin classes

Capture a thread and coroutine dump

If you need a report containing the state of each coroutine and its stack, use a thread dump.

IntelliJ IDEA's thread dumps can include:

  • Java platform threads

  • Virtual threads

  • Detected Kotlin coroutines and their stacks

Get coroutines dump

  • On the Debug tool window's toolbar, click More More, then select Get Thread Dump.

The More button on the Debug tool window toolbar
15 September 2026