analyze_threads
Analyze thread dumps from a Java process to identify lock contention and deadlocks, optionally returning structured JSON for lock-wait chains.
Instructions
Thread dump (jstack -l). Default: plain text. Set structured=true for JSON lock-wait chains (live snapshot). Historical contention: profile_jfr_locks. Deadlock cycle: check_deadlock.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Process ID of the Java application. Get this from list_java_processes. | |
| topN | No | Maximum number of threads to include in the output. Default: 10. Increase for applications with many threads. | |
| structured | No | Return structured JSON with lockWaitChains instead of plain-text dump. Default: false. |