Memory
A ruthlessly strict algorithmic optimization methodology for AI coding agents. Forces your agent to profile, benchmark, and mathematically prove performance gains before writing code.
npx -y skills add v0idOS/performance-deity --skill memoryAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Detect and fix memory leaks. Instruments memory tracking across thousands of iterations, proves the leak with growth data, identifies the uncollected reference, and verifies the fix.
SKILL.md
1.5 KB, as published. Nobody here has run it
Execute all four phases in order.
Phase 1 — Isolation
- Identify the code suspected of leaking.
- Write a wrapper that runs it in an infinite loop or for ≥1,000,000 iterations.
Phase 2 — Instrumentation
Inject memory tracking into the wrapper:
- Node.js:
process.memoryUsage().heapUsedbefore and after each iteration. - Python:
tracemalloc.start()/tracemalloc.get_traced_memory(). - PowerShell:
[System.GC]::GetTotalMemory($false).
If memory continuously grows without recovering after GC, the leak is confirmed. Show the growth numerically:
Iteration 0: 10 MB
Iteration 100k: 14 MB
Iteration 500k: 40 MB
Phase 3 — Fix
Identify the uncollected reference:
- Event listeners not removed from detached DOM nodes
- Global arrays or caches growing without a size limit
- Closures retaining large outer-scope objects
Apply the fix:
removeEventListenerfor DOM event listenersWeakMap/WeakReffor object-keyed associations that should not prevent GC- Object pooling to reuse memory instead of allocating new objects per cycle
Phase 4 — Report
Re-run the instrumented wrapper and present:
| Metric | Before | After |
|---|---|---|
| Memory growth per 10k ops | +50MB | +0MB |
| GC pause frequency | High | Stable |
Explain the root cause and the specific reference that was being retained.