optimize-memory-allocation

optimize-memory-allocation is a skill for Claude Code from zystem-io/zymtrace-skills. It costs 177 tokens per session (2,699 once invoked), scanned A, original, Apache-2.0.

A Java Virtual Machine memory-allocation analysis workflow. It examines which parts of a Java program create the most bytes or objects and where garbage collection—the cleanup of unused objects—uses time.

In plain words
What is it for?
Finding hot allocation sites, reading allocation flamegraphs and rankings, and investigating memory-allocation behavior in Java services. It does not apply to non-Java workloads.
Why use it?
It reveals allocation churn that can waste CPU or keep garbage collection busy, even when ordinary CPU profiles do not show the cause clearly.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the zymtrace plugin — 11 skills, 1 agent shipped together

Good fit Finding hot allocation sites, reading allocation flamegraphs and rankings, and investigating memory-allocation behavior in Java services. It does not apply to non-Java workloads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zystem-io/zymtrace-skills/optimize-memory-allocation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zystem-io/zymtrace-skills --skill optimize-memory-allocation
Clone the repo
git clone --depth 1 https://github.com/zystem-io/zymtrace-skills

Made for: Claude Code.

Or install zymtrace, the plugin that ships this one along with the rest of its 11 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimize-memory-allocation

README.md
[![agentmods](https://agentmods.dev/badge/skills/zystem-io/zymtrace-skills/optimize-memory-allocation/github.svg)](https://agentmods.dev/skills/zystem-io/zymtrace-skills/optimize-memory-allocation)
Your own site
<a href="https://agentmods.dev/skills/zystem-io/zymtrace-skills/optimize-memory-allocation"><img src="https://agentmods.dev/badge/skills/zystem-io/zymtrace-skills/optimize-memory-allocation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for optimize-memory-allocation

Your own site · 80×15
<a href="https://agentmods.dev/skills/zystem-io/zymtrace-skills/optimize-memory-allocation"><img src="https://agentmods.dev/badge/skills/zystem-io/zymtrace-skills/optimize-memory-allocation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 177 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,699 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00177 $0.02699
Opus 5.5 $0.00071 $0.01080
Sonnet 5.5 $0.00035 $0.00540
Haiku 4.5 $0.00018 $0.00270

Measured 15d ago against content hash ef47e79aa4c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

optimize-memory-allocation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

zymtrace/skills/optimize-memory-allocation/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimize JVM Memory Allocation

The MCP fetches the data — allocation rankings, allocation flamegraphs, host metrics; you analyze: name the hot allocation sites, identify the pattern, recommend and apply the fix.

Java/JVM only. zymtrace memory-allocation profiling is supported only for the JVM — it reads the allocation profile, stacks weighted by bytes allocated (and object count), not on-CPU time. A non-Java workload has no allocation profile: stay in optimize-cpu-workloads for its on-CPU hotspots. For GPU/device memory use optimize-gpu-workloads. A service that's crashing/OOMKilled rather than churning is a profiler/backend problem — route to troubleshoot-zymtrace-profiler.

The common discipline — data-source policy, pre-flight, rank-first vs. drill-down, scope-to-own-code/ROI, the always-recommend-and-apply-the-fix rule, the output-template skeleton, severity sizing, and security — lives in shared/analysis-conventions.md. Read it. This skill adds the allocation-specific protocol and call-tree rendering on top.

Connection setup lives in configure-zymtrace-mcp; this skill assumes the MCP is connected.

Enable allocation profiling first — it's opt-in

JVM allocation profiling is off by default. Before analyzing, confirm the Java service actually has an allocation profile (try the allocation ranking / flamegraph for it). If it's empty, it isn't enabled yet — turn it on, wait for profiles to arrive, then analyze. Don't fabricate an analysis when there's no allocation data; enable and wait. Full reference: https://docs.zymtrace.com/allocation-profiling.

Prerequisite: the target runs a supported JVM — OpenJDK, Azul Zulu, or Azul Zing.

To enable, ask the user for these inputs, then apply:

  • Target — a CEL expression scoping which workloads to profile (by container / deployment / host / project). Get the scope from the user; see the docs for CEL syntax.
  • Sampling interval — bytes between allocation samples. Default 16mib (production); 512kib for fine-grained at higher overhead.
  • JVMTI backend — use JVMTI as the sampling backend? Default on where supported.

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago Changed · +1 lines · -234 tokens per session ef47e79aa4c3
  2. 1mo ago Changed · -1 lines 92fb92b368bd
  3. 3mo ago First seen · 105 lines · 411 tokens per session scan A 6e715fbdd3a5

Subscribe to this mod's changes

optimize-memory-allocation is a skill published in the GitHub repository zystem-io/zymtrace-skills (8 stars, last pushed 6d ago), licensed Apache-2.0. It adds 177 tokens to every session and 2,699 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

optimize-memory-allocation compared with skills from other repositories

optimize-memory-allocation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
optimize-memory-allocationzystem-io/zymtrace-skillsSkill86d agoApache-2.0A177Claude Code
nullawaychromium/chromiumSkill26ktodayBSD-3-ClauseA43Claude Code, Codex
wxjava-troubleshooterbinarywang/WxJavaSkill33ktodayApache-2.0A65Codex
performance-smell-detectiondecebals/claude-code-javaSkill7821mo agoMITA51Claude Code, Codex
126-java-exception-handlingjabrena/plinthSkill470todayApache-2.0A144Claude Code, Codex
java-debugFgForrest/mcp-jdwp-javaSkill368d agoMITA60Claude Code
jstallparttimenerd/jstallSkill5416d agoMITA87Claude Code