javaperf memory gc

    1

    Diagnoses high JVM memory usage, GC pauses, and allocation pressure via 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 gc

    Example session with this skill installed

    My Spring Boot service is experiencing 500ms GC pauses every 10 seconds. Can you diagnose the cause and suggest improvements? The PID is 4521.

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

    I have analyzed the JVM metrics and JFR profile for PID 4521. The service is suffering from high allocation pressure in the young generation, leading to frequent minor GCs.

    JVM Memory and GC Diagnosis

    Target and JVM Config

    • PID: 4521 (Spring Boot)
    • GC Algorithm: G1GC
    • Heap Limits: -Xms2g, -Xmx4g
    • Container Limits: 6GB RAM (cgroups detected)

    GC Health

    • Total Pause Time: 4.2s over 60s window
    • Max Pause: 512ms
    • Frequency: Every 9.8s
    • Efficiency: Low (avg 120MB freed per minor GC)

    Verdict: Allocation rate (240MB/s) is exceeding the short-lived object reclamation capacity, forcing premature promotion.

    Top Allocators

    Stack / Allocation SiteBytesCountFix Idea
    com.api.dto.Mapping.transform()1.8 GB45,000Use a singleton ObjectMapper or streaming API
    java.lang.StringBuilder.append()920 MB120,000Pre-size builders for large logging strings
    org.hibernate.internal.CacheImpl410 MB12,000Reduce query result set size

    Off-Heap Summary

    • Code Cache: 42MB used / 240MB max
    • Metaspace: 112MB used / Unlimited max
    • Direct Buffers: 15MB

    Recommendations
    1.

    Optimize DTO Transformation: The transform method is creating excessive short-lived objects. Refactor to reuse buffers or use a more memory-efficient mapping strategy.
    2. Adjust G1 Region Size: Increase -XX:G1HeapRegionSize=8M to handle larger allocations more efficiently.
    3.

    Tune Initiating Heap Occupancy: Set -XX:InitiatingHeapOccupancyPercent=35 to start concurrent marking earlier and avoid evacuation failures.

    Next steps

    • Apply the ObjectMapper optimization in com.api.dto.Mapping.
    • Restart the service with -XX:+PrintGCDetails and the suggested G1 flags.
    • Re-run the javaperf profile during the next peak load to verify pause reduction.

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

    About this skill

    Diagnoses high JVM memory usage, long or frequent GC pauses, and allocation pressure in a running Java app via the javaperf MCP server (JFR allocation profile, GC efficiency, heap and native memory summaries). Use when the user reports GC pauses, high heap or RSS usage, OutOfMemory risk, too many allocations, or asks to tune heap or GC settings. Not for slowly growing leaks.

    Requires local attach access on same host/user. JFR 10ms sampling may miss fast methods. NMT requires -XX:NativeMemoryTracking flag. Not for slow-growing leaks.

    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 uses the javaperf MCP server to analyze Java Flight Recorder (JFR) data and Native Memory Tracking (NMT) outputs, identifying specific code paths and classes causing memory pressure rather than just reporting high-level metrics.

    It requires a JVM environment running JDK 8u262+ or JDK 11+, along with the javaperf MCP server installed on the target host. The AI agent must have permissions to execute local diagnostic commands like jcmd and jps under the same OS user.

    Yes, the skill is designed to audit container limits and detect discrepancies between heap settings and Docker/Kubernetes memory constraints, making it ideal for troubleshooting OOMKills in cloud environments.

    The purchase includes the complete MCP skill configuration, optimized logic for parsing JFR profiles, and a step-by-step diagnostic workflow for the javaperf server.

    No, the skill uses JFR and internal JVM diagnostic commands which generally incur less than 1% overhead, making it safe for use in production environments to capture real-time performance data.

    While it can analyze current off-heap usage via NMT, tracking specific native memory leaks usually requires a JVM restart with NMT enabled to establish a baseline for comparison.

    New in LLM Ops