javaperf threads deadlocks

    1

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

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 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.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Node.js
    Jperf MCP

    Permissions

    Network Access
    Listed1 month ago

    What's inside

    Frequently Asked Questions

    This skill automates the identification of thread-locking issues like circular deadlocks, lock convoys, and connection pool starvation by analyzing live thread dumps and JFR data, eliminating the need for manual, error-prone parsing of raw JVM logs.

    The skill requires a host running JDK 8u262 or JDK 11+ and functions on any system where the javaperf MCP server is installed with local attach permissions for the target JVM.

    While standard thread dumps identify current deadlocks, the JFR profiling feature captures transient lock contention and wait durations over time, allowing the agent to diagnose intermittent performance dips that don't result in a total freeze.

    Yes, this skill is specifically designed to recognize thread patterns in popular frameworks like Tomcat, HikariCP, and ForkJoinPool, making it highly effective for identifying infrastructure-level bottlenecks.

    Upon purchase, you receive the production-ready skill definition, including all necessary tool mappings for thread analysis and JFR profiling, along with documentation for integrating it into your MCP-compatible AI agent environment.

    New in LLM Ops