grey-haven-memory-profiling
About
This skill identifies memory leaks, inefficient allocations, and optimization opportunities in JavaScript/TypeScript and Python applications. It analyzes heap snapshots, allocation patterns, and garbage collection behavior to diagnose issues when memory grows over time or performance degrades. Use it when you encounter high memory consumption or terms like 'memory leak' and 'heap analysis'.
Quick Install
Claude Code
Recommended/plugin add https://github.com/greyhaven-ai/claude-code-configgit clone https://github.com/greyhaven-ai/claude-code-config.git ~/.claude/skills/grey-haven-memory-profilingCopy and paste this command in Claude Code to install this skill
Documentation
Memory Profiling Skill
Identify memory leaks, inefficiencies, and optimization opportunities in running applications through systematic heap analysis and allocation profiling.
Description
Specialized memory profiling skill for analyzing allocation patterns, heap usage, garbage collection behavior, and memory retention in JavaScript/TypeScript (Node.js, Bun, browsers) and Python applications. Detect memory leaks, optimize memory usage, and prevent out-of-memory errors.
What's Included
Examples (examples/)
- Memory leak detection - Finding and fixing common leak patterns
- Heap snapshot analysis - Interpreting Chrome DevTools heap snapshots
- Allocation profiling - Tracking memory allocation over time
- Real-world scenarios - E-commerce app leak, API server memory growth
Reference Guides (reference/)
- Profiling tools - Chrome DevTools, Node.js inspector, Python memory_profiler
- Memory concepts - Heap, stack, GC algorithms, retention paths
- Optimization techniques - Object pooling, weak references, lazy loading
- Common leak patterns - Event listeners, closures, caching, timers
Templates (templates/)
- Profiling report template - Standardized memory analysis reports
- Heap snapshot comparison template - Before/after analysis
- Memory budget template - Setting and tracking memory limits
Checklists (checklists/)
- Memory leak checklist - Systematic leak detection process
- Optimization checklist - Memory optimization verification
Use This Skill When
- ✅ Memory usage growing continuously over time
- ✅ High memory consumption detected (> 500MB for Node, > 1GB for Python)
- ✅ Performance degradation with prolonged runtime
- ✅ Out of memory errors in production
- ✅ Garbage collection causing performance issues
- ✅ Need to optimize memory footprint
- ✅ User mentions: "memory leak", "memory usage", "heap", "garbage collection", "OOM"
Related Agents
memory-profiler- Automated memory analysis and leak detectionperformance-optimizer- Broader performance optimization including memory
Quick Start
# View leak detection examples
cat examples/memory-leak-detection.md
# Check profiling tools reference
cat reference/profiling-tools.md
# Use memory leak checklist
cat checklists/memory-leak-checklist.md
Common Memory Issues
- Event Listener Leaks - Unremoved listeners holding references
- Closure Leaks - Variables captured in closures never released
- Cache Leaks - Unbounded caches growing indefinitely
- Timer Leaks - setInterval/setTimeout not cleared
- DOM Leaks - Detached DOM nodes retained in memory
- Circular References - Objects referencing each other preventing GC
Typical Workflow
- Detect: Run profiler, take heap snapshots
- Analyze: Compare snapshots, identify growing objects
- Locate: Find retention paths, trace to source
- Fix: Remove references, clean up resources
- Verify: Re-profile to confirm fix
Skill Version: 1.0 Last Updated: 2025-11-09
GitHub Repository
Related Skills
subagent-driven-development
DevelopmentThis skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.
algorithmic-art
MetaThis Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.
executing-plans
DesignUse the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.
cost-optimization
OtherThis Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.
