commonfabric/labs/deno-memory-profiler
Claude Code and agent skill by commonfabric/labs
- community
Checking that the SKILL.md file is still in the repository.
Analyze memory in a running Deno process via the V8 inspector CDP protocol. Use when the user asks about memory usage, memory leaks, heap analysis, heap snapshots, allocation profiling, or object retention in a Deno process running with --inspect.
Install
npx vskill@latest install commonfabric/labs/deno-memory-profilerSKILL.md
Deno Memory Profiler
Analyze memory in a running Deno process via the V8 inspector CDP protocol.
When to use
Use this skill when the user asks about:
- Memory usage of a running Deno process
- Memory leaks or growing heap
- Heap analysis or heap snapshots
- Allocation profiling
- Object retention or constructor counts
The target Deno process must be running with --inspect or --inspect-brk. The default inspector port is 9229.
Prerequisites
The target process must be started with the inspect flag:
Available commands
The script is at skills/deno-memory-profiler/scripts/memory.ts. When run_skill_script is available and exactly allowlisted, invoke it with skill="deno-memory-profiler" and path="scripts/memory.ts" instead of constructing a shell command.
All commands accept --port=<port> (default 9229) and --host=<host> (default 127.0.0.1). Output is JSON to stdout; status messages go to stderr.
usage — Quick heap stats
Returns usedSize, totalSize, usagePercent. Use --gc to force garbage collection before measuring for a more accurate picture.
eval <expression> — Evaluate in target process
Runs an expression in the target via Runtime.evaluate and prints the result. Useful for inspecting specific objects.
sample — Allocation sampling
Profiles allocations for the given duration. Returns the top allocation sites sorted by bytes allocated. Options:
--duration <seconds>— sampling time (default 5)--top <N>— number of sites to show (default 30)--interval <bytes>— sampling interval (default 32768; lower = more detail,
more overhead)
snapshot — Full heap snapshot summary
Takes a V8 heap snapshot and produces a summary: total size, top 20 constructors by shallow size, top 10 by instance count, and duplicate strings (>50 occurrences).
diff baseline / diff compare — Leak detection
Two-phase leak detection. Baseline saves a snapshot summary to /tmp/memory-baseline-{port}.json. Compare takes a new snapshot and reports:
- Total heap growth (bytes and percent)
- New constructors not in baseline
- Constructors with increased instance count or size
- Constructors that disappeared
Workflow examples
Quick health check
Get the current heap state after GC. Good first step to see if memory is unexpectedly high.
Allocation profiling
Run this while the user triggers their workload. Shows where allocations are happening — useful for finding hot allocation paths.
Leak detection
The diff shows what grew. Focus on constructors with large deltaCount or deltaSize.
Deep inspection
Interpreting results
- Large shallow size with high count: Usually arrays, buffers, or string
data being retained. Look at what constructor owns them and trace back to why they're kept alive.
- Growing constructors between baseline and compare: These are likely leaks
— objects being created but not released. Focus on the ones with the highest deltaCount.
- High allocation count in sampling: Hot allocation paths that may benefit
from object pooling, caching, or restructuring to reduce GC pressure.
- Duplicate strings: Many identical strings suggest opportunities for string
interning or indicates a pattern creating redundant string copies.
- New constructors in diff compare: Types that didn't exist at baseline may
indicate new subsystems being loaded, or leaked closures/objects from the triggered operation.
Limitations
- Snapshot size: Snapshot parsing can be slow and memory-intensive for very
large heaps (>500MB). The profiler process itself needs memory to parse the JSON.
- Sampling is duration-based: Coordinate with the user on timing — the
sampling period should overlap with the workload being profiled.
- No retained size: Computing retained size requires building a dominator
tree, which is expensive. Shallow size grouped by constructor is provided instead, which is still very useful for identifying leaks and large allocations.
- Single target: Connects to the first debuggable target. If multiple
isolates are running, only the first is profiled.
- Inspector must be enabled: The target process must be running with
--inspect. There's no way to attach to a process that wasn't started with this flag.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/deno-memory-profiler/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/commonfabric/labs/deno-memory-profiler)