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.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 5 days ago
- Free to download with an account
Requires