javaperf memory leak
Hunts Java memory leaks with heap histograms, old-object samples, and the javaperf MCP server.
Free
Works with the AI Agents you already use
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 | Δ Bytes | Consistent? |
|---|---|---|---|
com.example.session.UserSession | +1,420 | +227,200 | Yes (3/3) |
java.util.concurrent.ConcurrentHashMap$Node | +1,420 | +45,440 | Yes (3/3) |
char[] | +2,840 | +181,760 | Yes (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
- Inspect
SessionManager.javaat line 84 to verify the eviction policy on the static map. - Check if
SessionExpiredEventlisteners are correctly removing entries. - If the code looks correct, run
heap_dumpto 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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