javaperf cpu hotspots

    1

    Finds CPU hot spots in a running Java service via JFR 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 cpu hotspots

    Example session with this skill installed

    My Java service at PID 4521 is hitting 90% CPU under load. Can you find the hot spots?

    • Read your context and instructions
    • Compiled the javaperf cpu hotspots

    I have recorded a 60-second JFR profile for PID 4521. The recording captured 5,842 CPU samples during the load window. The analysis shows the service is heavily CPU-bound, primarily due to intensive JSON serialization and regex matching in the request processing layer.

    CPU Hot Spot Analysis

    RankMethod% SamplesCall PathLikely Cause
    1com.auth.Token.verify()42.1%AuthFilter -> JWT.parseRe-compiling Regex pattern on every call.
    2com.data.Mapper.toJson()28.4%ApiController -> ResponseReflective access in legacy Jackson version.
    3java.util.regex.Pattern.matcher12.8%Token.verifySide effect of Rank 1 method.
    4zip.Deflater.deflateBytes7.2%GzipFilterHigh compression level (9) on small payloads.

    Verdict: The service is compute-bound. 70% of CPU time is spent in two specific methods related to security and serialization.

    Fixes to try:

    1. Cache Regex Patterns: Move the Pattern.compile call in Token.verify() to a static final constant.
    2. Upgrade Jackson: Update jackson-databind to 2.15+ to benefit from improved property cache lookups.
    3. Adjust GZIP: Lower the compression level to 6 or implement a payload size threshold for compression.

    Next steps

    • Apply the static Regex fix and re-run the profile.
    • Verify if the com.data.Mapper can be replaced with a pre-generated serializer.
    • Check compiler_codecache if performance stays inconsistent after fixes.

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

    About this skill

    Finds CPU hot spots in a running Java service by recording JFR under load and ranking the hottest methods and call paths via the javaperf MCP server. Use when the user says the Java backend is slow, has high CPU or latency, wants to find hot spots during a load test, or asks which methods burn the most CPU.

    Requires javaperf MCP server and local JVM access. JFR sampling (10ms) may miss very fast methods. Does not cover heap leaks or lock contention.

    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 execution and analysis of Java Flight Recorder (JFR) sessions, transforming raw binary profiling data into actionable insights about which specific code methods are consuming the most CPU cycles.

    The skill requires a host environment with JDK 8u262+ or 11+, Node.js 18+, and the javaperf MCP server installed to bridge the AI agent with your local JVM processes.

    Yes, by utilizing Java Flight Recorder's low-overhead sampling, this skill can safely profile production services to diagnose high CPU usage or latency spikes with minimal impact on application performance.

    While this skill is purpose-built for CPU execution profiling and call-path analysis, it is not designed to detect memory leaks, heap issues, or thread deadlocks.

    You receive the specialized AI agent skill configuration and instructions necessary to orchestrate JVM discovery, JFR data parsing, and automated diagnostic reporting via the javaperf MCP server.

    New in LLM Ops