javaperf threads deadlocks
Diagnoses hung Java apps, deadlocks, lock contention, and thread-pool starvation via javaperf.
Free
Works with the AI Agents you already use
javaperf threads deadlocks
Example session with this skill installed
The Java service at PID 4521 is unresponsive. CPU is low but it's not processing any requests. Check for deadlocks or thread pool issues.
- Read your context and instructions
- Compiled the javaperf threads deadlocks
I have analyzed the thread state for PID 4521. The investigation detected a classic deadlock between two worker threads and evidence of starvation in the HTTP NIO pool.
JVM Thread Analysis Report (PID 4521)
| Thread Name | State | Lock Identifier | Lock Owner | Stack Frame (Top) |
|---|---|---|---|---|
inventory-svc-1 | BLOCKED | 0x000000071234 (OrderSync) | inventory-svc-2 | com.app.Inv.update(Inv.java:42) |
inventory-svc-2 | BLOCKED | 0x000000075678 (StockSync) | inventory-svc-1 | com.app.Stock.reserve(Stock.java:88) |
http-nio-8080-1 | WAITING | 0x000000079999 (HikariPool) | N/A | com.zaxxer.hikari.pool.HikariPool.getConnection |
http-nio-8080-2 | WAITING | 0x000000079999 (HikariPool) | N/A | com.zaxxer.hikari.pool.HikariPool.getConnection |
Hot Locks (JFR Data)
| Lock / Class | Total Wait Time | Wait Count | Top Waiting Stack |
|---|---|---|---|
java.util.concurrent.locks.ReentrantLock$NonfairSync | 45,201 ms | 12 | com.app.service.SharedService.process |
com.zaxxer.hikari.pool.ProxyConnection | 12,400 ms | 85 | com.app.dao.BaseDao.query |
Verdict: Deadlock detected between inventory worker threads. Secondary pool starvation observed in the HTTP NIO pool due to threads waiting indefinitely for DB connections that are never released by the deadlocked threads.
Fix to try:
- Implement a consistent locking order for
OrderSyncandStockSyncresources to break the cycle. - Add a
connection-timeoutto the HikariCP configuration to prevent the entire HTTP pool from hanging. - Wrap the synchronized blocks in
tryLockwith a timeout to allow graceful failure.
Next steps
- Apply the lock ordering fix to the
InventoryandStockclasses. - Restart the JVM and run
check_deadlockto verify the cycle is resolved. - Monitor
profile_jfr_locksfor 5 minutes to ensure no new contention points emerge.
Connects securely to your tools. The creator never sees your data.
About this skill
Diagnoses hung or stuck Java apps, deadlocks, lock contention, and thread pool starvation using live thread dumps, deadlock detection, and JFR lock events via the javaperf MCP server. Use when the user says the Java app hangs, freezes, stops responding, requests pile up or time out with low CPU, suspects a deadlock, or asks why threads are BLOCKED or WAITING.
Requires local attach permissions on the same host and OS user. JFR sampling (10ms) may miss very short methods. Remote JVMs not supported.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
1 use
Times used to date
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 month ago
- Free with an Agensi account
Requires