javaperf cpu hotspots
Finds CPU hot spots in a running Java service via JFR and the javaperf MCP server.
Free
Works with the AI Agents you already use
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
| Rank | Method | % Samples | Call Path | Likely Cause |
|---|---|---|---|---|
| 1 | com.auth.Token.verify() | 42.1% | AuthFilter -> JWT.parse | Re-compiling Regex pattern on every call. |
| 2 | com.data.Mapper.toJson() | 28.4% | ApiController -> Response | Reflective access in legacy Jackson version. |
| 3 | java.util.regex.Pattern.matcher | 12.8% | Token.verify | Side effect of Rank 1 method. |
| 4 | zip.Deflater.deflateBytes | 7.2% | GzipFilter | High 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:
- Cache Regex Patterns: Move the
Pattern.compilecall inToken.verify()to a static final constant. - Upgrade Jackson: Update
jackson-databindto 2.15+ to benefit from improved property cache lookups. - 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.Mappercan be replaced with a pre-generated serializer. - Check
compiler_codecacheif 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.
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