javaperf threads deadlocks

    1

    Diagnoses hung Java apps, deadlocks, lock contention, and thread-pool starvation via javaperf.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    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 NameStateLock IdentifierLock OwnerStack Frame (Top)
    inventory-svc-1BLOCKED0x000000071234 (OrderSync)inventory-svc-2com.app.Inv.update(Inv.java:42)
    inventory-svc-2BLOCKED0x000000075678 (StockSync)inventory-svc-1com.app.Stock.reserve(Stock.java:88)
    http-nio-8080-1WAITING0x000000079999 (HikariPool)N/Acom.zaxxer.hikari.pool.HikariPool.getConnection
    http-nio-8080-2WAITING0x000000079999 (HikariPool)N/Acom.zaxxer.hikari.pool.HikariPool.getConnection

    Hot Locks (JFR Data)

    Lock / ClassTotal Wait TimeWait CountTop Waiting Stack
    java.util.concurrent.locks.ReentrantLock$NonfairSync45,201 ms12com.app.service.SharedService.process
    com.zaxxer.hikari.pool.ProxyConnection12,400 ms85com.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:

    1. Implement a consistent locking order for OrderSync and StockSync resources to break the cycle.
    2. Add a connection-timeout to the HikariCP configuration to prevent the entire HTTP pool from hanging.
    3. Wrap the synchronized blocks in tryLock with a timeout to allow graceful failure.

    Next steps

    • Apply the lock ordering fix to the Inventory and Stock classes.
    • Restart the JVM and run check_deadlock to verify the cycle is resolved.
    • Monitor profile_jfr_locks for 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

    Node.js
    Jperf MCP

    Listed5 days ago

    What's inside

    Frequently Asked Questions