Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Memory Profiling?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-memory-profiling)
---
name: memory-profiling
description: Memory profiling — heap snapshots and comparison, allocation timelines, retainer paths, common leaks (listeners, caches without bounds, closures, timers), GC behaviour and pauses, container memory limits and OOM kills. Use for memory leaks, growth or OOMs (memory leak, heap snapshot, OOM, GC, retainers).
metadata:
category: performance
---
# Memory profiling
## Purpose
Find what holds memory and why, then bound it.
**Use when:** memory growth, OOM kills, GC pauses.
**Not for:** CPU hot paths.
## Inputs
- Memory metrics, reproducible scenario.
## Outputs
- Leak analysis with retainer paths and fix.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "memory profiling"` for prior decisions, patterns and anti-patterns.
- [Memory leak playbook](../../../playbooks/memory-leak.md)
## Steps
1. **Confirm.** Distinguish leak (unbounded growth) from high steady state.
Done when growth pattern shown.
2. **Snapshot.** Take heap snapshots over time; diff.
Done when growing object types identified.
3. **Retainers.** Follow retainer paths to the owner.
Done when root holder named.
4. **Fix.** Bound or release; verify flat memory under the same load.
Done when memory stable over soak.
## Best practices
- Three snapshots: baseline, after load, after GC.
- Bound every cache.
## Common mistakes
- Raising memory limits as a fix.
- Snapshots in production without approval.
## Example
Event listeners added per request on a shared emitter; fixed with `once`; memory flat over 6-hour soak.
## Reusable prompt
```text
Apply the Memory profiling skill (.agents/skills/memory-profiling/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Confirm the leak, compare heap snapshots, follow retainers to the cause and verify the fix with a soak.
Return: Leak analysis with retainer paths and fix..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```