- Home
- Skills
- Code Quality & Review
- Zero-Allocation Java Review for Hot Paths
Works with the AI Agents you already use
Zero-Allocation Java Review for Hot Paths
Reviews Java hot paths (render, tick, simulation loops) for heap allocations: cost model, reuse patterns, JFR methodology — no cargo-cult pooling
Free
Zero-Allocation Java Review for Hot Paths
Example session with this skill installed
Review this market data handler for allocations — it runs on every tick: <paste MarketFeedHandler.java>
- Read your context and instructions
- Compiled the zero-allocation java review
Findings
| # | Severity | Location | Finding |
|---|---|---|---|
| 1 | HIGH | handle(), new VenueParser | Parser built per tick — hoist to a cached field |
| 2 | HIGH | venue loop | for (Venue v : venues) allocates an iterator — indexed loop |
| 3 | MED | toQty() | Double.valueOf boxing on the hot path — primitive double path |
| 4 | LOW | venue guard | Unknown venue ids dropped silently — counter + rate-limited log |
Fix sketch (Finding 1)
private final VenueParser parser = new VenueParser(); // owner-confined scratch, reused every tick
Methodology
jdk.ObjectAllocationSample (10 ms threshold) over a 5-minute soak. Findings 1-2 confirmed by TLAB churn in the profile; Finding 3 is a boxing pattern flagged by inspection, verify with the same event; Finding 4 is correctness, not allocation.
Next steps
- Apply fixes 1-2, re-run the soak, compare allocation rate
- Finding 4: decide the policy for unknown venues before release
Connects securely to your tools. The creator never sees your data.
About this skill
A code-review skill for Java hot paths: render loops, tick and simulation code, per-element loops. It hunts heap allocations that drive GC pressure — with a cost model, not cargo cult.
What it does
- Checklist of allocation sites: boxing, implicit iterators, string concatenation, per-element
new, vector-math temporaries - Reuse patterns reference: cached scratch fields, dest-argument APIs, ThreadLocal buffers, object pools — each with rules and anti-patterns (pooling everything, micro-caching mutable results)
- JFR methodology: what to measure before recommending a fix, and when escape analysis already removes the allocation for free
- Report format ranks findings by real cost and honestly marks claims unverified without a profile
- Sample review of a MarketFeedHandler included
Born in the hot paths of a real voxel engine render loop.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.
Focuses only on hot paths (frame/tick/message loops). Ignores startup, UI, and error paths. Requires external profiling data (JFR/async-profiler) for maximum accuracy.
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 buying a skill.
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
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 22 days ago
- Free with an Agensi account