javaperf memory leak

    1

    Hunts Java memory leaks with heap histograms, old-object samples, and the javaperf MCP server.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    javaperf memory leak

    Example session with this skill installed

    My Java app at PID 4502 is slowly climbing in memory. It has been up for 4 hours and GC isn't helping. Can you find what's leaking?

    • Read your context and instructions
    • Compiled the javaperf memory leak

    I have analyzed the heap histogram deltas and JFR old object samples for PID 4502 over a 60-second window. The data shows a consistent growth in com.example.session.UserSession objects that are not being reclaimed.

    Leak Analysis for PID 4502

    Class NameΔ InstancesΔ BytesConsistent?
    com.example.session.UserSession+1,420+227,200Yes (3/3)
    java.util.concurrent.ConcurrentHashMap$Node+1,420+45,440Yes (3/3)
    char[]+2,840+181,760Yes (3/3)

    Allocation Origin:
    JFR profiling shows these objects are instantiated via com.example.auth.SessionManager.createSession during incoming HTTP requests.

    Retention Hypothesis:
    The UserSession objects are being added to a static ConcurrentHashMap inside SessionManager. While a cleanup task exists, the GC efficiency report shows par new and concurrent mark sweep cycles are reclaiming 0% of these specific instances, suggesting the "remove" logic is failing or the TTL is effectively infinite.

    Confidence: High. The instance count for the Map nodes exactly matches the UserSession growth.

    Next steps

    1. Inspect SessionManager.java at line 84 to verify the eviction policy on the static map.
    2. Check if SessionExpiredEvent listeners are correctly removing entries.
    3. If the code looks correct, run heap_dump to confirm the exact GC root path in Eclipse MAT.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Hunts Java memory leaks by comparing live heap histograms over time, recording old-object samples, and building a retention hypothesis, with an optional heap dump for Eclipse MAT, via the javaperf MCP server. Use when the user says heap keeps growing, memory never comes back after GC, the app OOMs after hours or days, or asks to find a memory leak.

    Requires local host access to JVM. JFR sampling may miss objects created in very short methods. Production impact during heap dumps or full GC histograms.

    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 detection of Java memory leaks by performing multi-step histogram delta analysis and JFR profiling, effectively distinguishing between genuine leaks and temporary spikes in garbage collection.

    The skill requires JDK 8u262+ or 11+ and depends on the javaperf MCP server being installed on the same host and under the same OS user as the target JVM.

    Yes, it utilizes JFR (Java Flight Recorder) old object sampling and managed heap dumping, specifically designed to capture diagnostics while minimizing the performance impact on production environments.

    It is compatible with any AI agent or platform that supports the Model Context Protocol (MCP) and can interface with the javaperf server on your local machine.

    You receive the specialized agent skill configuration, which includes the logic for multi-step differential analysis, GC efficiency tracking, and retention hypothesis generation.

    No, this skill requires the MCP server to be on the same host as the JVM; it currently does not support remote attachment or monitoring across different network nodes.

    New in LLM Ops