Skip to content
Back to skills

Memory Profiling

ASecurity

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).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgoperformance

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill memory-profiling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memory Profiling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memory Profiling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-memory-profiling/badge)](https://www.skillsdirectory.com/skills/vectora-os-memory-profiling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.