Capture the dump
Expose the endpoint over HTTP in application.properties:
application.properties
management.endpoints.web.exposure.include=health,threaddump
The endpoint answers in JSON by default. For text, ask for it with the Accept header:
Text variant
curl -s -H "Accept: text/plain" http://localhost:8080/actuator/threaddump -o threaddump.txt
One dump is a single instant. Take two or three, 10 seconds apart, and compare which threads stay in the same place:
Three dumps, 10 seconds apart
for i in 1 2 3; do curl -s http://localhost:8080/actuator/threaddump -o threaddump-$i.json; sleep 10; done
The dump exposes internal detail of the application. Keep the endpoint behind authentication or on a private management port. For the other ways to capture a dump, see how to take a thread dump.
Reading the JSON by hand
The JSON has one key at the top, threads: a list with one object per thread. Read these fields first:
threadState: RUNNABLE, BLOCKED, WAITING or TIMED_WAITING.lockName: the lock the thread waits for, asclass@hashwith the hash in hex. Only present while the thread waits for a lock.lockOwnerNameandlockOwnerId: the thread that holds that lock. Only present when the lock has an owner;lockOwnerIdis -1 otherwise.lockedMonitors: the monitors this thread holds, withidentityHashCodein decimal.
This is thread order-worker-1 from a real dump of our reproduction (Spring Boot 3.5.12, JDK 25.0.2), cut where marked with ...:
threaddump.json (cut)
{ "threadName": "order-worker-1", "threadId": 55, ... "lockName": "com.acme.shop.ShopApplication$InventoryLock@7de97652", "lockOwnerId": 56, "lockOwnerName": "inventory-worker-1", ... "threadState": "BLOCKED", ... "stackTrace": [ { "methodName": "decrement", "fileName": "ShopApplication.java", "lineNumber": 102, "className": "com.acme.shop.ShopApplication$InventoryService", "nativeMethod": false }, { "methodName": "reserve", "fileName": "ShopApplication.java", "lineNumber": 83, "className": "com.acme.shop.ShopApplication$OrderService", "nativeMethod": false }, ... ], "lockedMonitors": [ { "className": "com.acme.shop.ShopApplication$OrderLock", "identityHashCode": 2111952093, "lockedStackFrame": { "methodName": "reserve", "fileName": "ShopApplication.java", "lineNumber": 83, "className": "com.acme.shop.ShopApplication$OrderService", "nativeMethod": false }, "lockedStackDepth": 1 } ], ... }
order-worker-1 is BLOCKED on an InventoryLock that inventory-worker-1 holds, while it holds an OrderLock itself. The other thread is the mirror image: it waits for the OrderLock that order-worker-1 holds. Two threads, each waiting for the other: a deadlock.
The text variant carries the same facts. The hash is in hex, owned by names the holder and - locked lines are the monitors the thread holds:
threaddump.txt (cut)
"order-worker-1" - Thread t@55 java.lang.Thread.State: BLOCKED at com.acme.shop.ShopApplication$InventoryService.decrement(ShopApplication.java:102) - waiting to lock <7de97652> (a com.acme.shop.ShopApplication$InventoryLock) owned by "inventory-worker-1" t@56 at com.acme.shop.ShopApplication$OrderService.reserve(ShopApplication.java:83) - locked <7de1d4dd> (a com.acme.shop.ShopApplication$OrderLock) ...
What it leaves out compared to jstack
We took the same process three ways, seconds apart. The Actuator dump has 43 threads; jstack -l listed 65. Compared to jstack, the Actuator dump does not have:
- the 22 threads internal to the JVM (garbage collector, C1 and C2 compilers, VM Thread, Service Thread);
- virtual threads (50 in that process);
- the
Found one Java-level deadlocksection; nid, native address, CPU time and elapsed time per thread;- in the text variant, daemon and priority.
It is enough when the question is about your application: locks, request threads, pools. Ask someone with a shell for jcmd <pid> Thread.print -l > dump.txt when you need the JVM internal threads, CPU time per thread or the deadlock section as the JVM writes it.
What the analyzer returns
The dump above comes from a Tomcat with 8 request threads and a planted fire. ThreadMine reads the JSON and the text and reports three findings:
Deadlock detected involving 2 threads
order-worker-1, inventory-worker-1
Deadlock detected: two or more threads are blocked on each other waiting for locks. Requires immediate action — the application will not recover on its own.
3 threads waiting for lock 2e29d797
3 threads
Lock held by: report-nightly-job
5 HTTP requests stuck out of 8 threads
5 of 8 threads
5 of 8 HTTP threads stuck (63%)
The Actuator dump has no deadlock section, so ThreadMine infers the deadlock from lock ownership: threads BLOCKED on a lock that another thread of the cycle holds.
Paste the JSON or the text from your own /actuator/threaddump.
Analyze my dump nowRead more about the deadlock analyzer and stuck threads in Spring Boot.
Frequently asked questions
How do I enable the thread dump endpoint?
Have Spring Boot Actuator on the classpath and expose the threaddump endpoint through the web exposure property (the exact line is under "Capture the dump"). The endpoint is then GET /actuator/threaddump on the management port. It returns JSON by default.
Should I send the JSON or the text?
Either one: the analyzer reads both. The JSON is the default and keeps daemon and priority for each thread. The text variant (header Accept: text/plain) looks like a jstack dump, without the JVM internal threads and without the deadlock section, and it drops daemon and priority.
Why does the Actuator dump have fewer threads than jstack?
It lists the threads that the JVM exposes through ThreadMXBean, not the JVM internals. In our measurement on one process, jstack -l listed 65 threads and the Actuator 43. The 22 missing are internal to the JVM (garbage collector, C1 and C2 compilers, VM Thread, Service Thread). The 50 virtual threads of that process are not in the Actuator dump either.
Does the Actuator thread dump show a deadlock?
It has no deadlock section, unlike jstack. The deadlock is still in the data: each thread of the cycle is BLOCKED on a lock owned by the next one (lockOwnerName in the JSON, owned by in the text). Follow the owners until you come back to the first thread. ThreadMine does this for you and reports the cycle as a deadlock.
Is it safe to expose /actuator/threaddump?
Not without protection. The dump lists thread names, class names, line numbers and the locks of your application. Keep the endpoint behind authentication or on a private management port, and never open it to the internet.
Got the dump from /actuator/threaddump?
Paste the JSON or the text and see the locks and the stuck requests. No signup for the first dump.