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.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 5 days ago
- Free to download with an account
Requires