memory-leak-detector
SkillDocs & knowledgeIdentifies unclosed handles, event listener accumulation, retain cycles, and heap memory leak patterns.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the memory-leak-detector skill
What this skill tells your AI
The instructions your AI receives, as published by codebygarv/ai-skills in skills/development/memory-leak-detector/SKILL.md and read by ahel’s review.
Purpose
Detect and fix memory leaks, lingering closures, detached DOM trees, unbounded cache growth, and uncollected resources in Node.js, JavaScript, Python, Go, and mobile applications.
When to Use
- Applications whose memory (RSS / Heap) steadily climbs until crashing with Out-Of-Memory (OOM) errors.
- Investigating heap profile snapshots and GC thrashing.
- Reviewing caching layers, WebSocket connection registries, and event listeners.
What to Analyze
- Unbounded In-Memory Collections: Global arrays/maps that append data without TTL, LRU eviction, or size caps.
- Lingering Event Listeners / Subscriptions: Attaching listeners on recurring objects without matching
removeEventListener/unsubscribe. - Closure Scope Retention: Outer scope variables captured unintentionally by long-lived closures or callbacks.
- Unclosed System Handles: Database connections, file descriptors, streams, or timers (
setInterval) left running. - Detached DOM Nodes: In frontend SPAs, keeping JS object references to HTML elements removed from the document.
Output Format
- Leak Mechanism: Detailed explanation of why the garbage collector cannot free the allocated memory.
- Code Offender: Exact snippet causing the retention.
- Fixed Implementation: Leak-free pattern (using WeakMap, LRU caches, cleanup hooks, or
AbortController). - Heap Verification Guide: How to verify the fix via heap snapshots or profiling tools.
Avoid
- Band-aid solutions like restarting pods every 2 hours without fixing the leak.
- Using plain Javascript
MaporObjectas unbounded global caches.
Signals
- GitHub stars
- 26
- Forks
- 1
- Last commit
- Aug 2026
Others that do the same job
Advanced
- Item type
- skill
- Key
memory-leak-detector-codebygarv- Source
- github.com/codebygarv/ai-skills
github.com/codebygarv/ai-skills
Related picks
Skill · samber
The pick for Gogo-sdk-specialist
Skill · a5c-ai
The pick for Golegacy-js
Skill · thedaviddias
The pick for JavaScriptmodern-javascript-patterns
Skill · wshobson
The pick for JavaScriptpython-performance-optimization
Skill · wshobson
The pick for Pythonpython-pro
Skill · jeffallan
The pick for Python