
Memory Leak Detection
This handles the detective work of tracking down memory leaks in Node.js and Python apps. You get heap snapshot utilities, profiling helpers, and middleware to monitor memory growth over time. The reference guides cover the usual suspects: event listeners that never detach, forgotten timers, cache bloat, and circular references. It pushes WeakMap and WeakRef pretty hard for caching, which is the right call if you're holding references to objects you don't fully control. Most useful when you're debugging OOM crashes or watching container memory creep up in production. The monitoring patterns are more practical than the basic profiler examples.
- skills.sh installs
- 589
- GitHub stars
- 379
- last updated
- Aug 21, 2026
Install
$ npx -y skills add aj-geddes/useful-ai-prompts --skill memory-leak-detection --agent claude-codeInstalls into .claude/skills of the current project.
Files
Memory Leak Detection
Table of Contents
Overview
Identify and fix memory leaks to prevent out-of-memory crashes and optimize application performance.
When to Use
- Memory usage growing over time
- Out of memory (OOM) errors
- Performance degradation
- Container restarts
- High memory consumption
Quick Start
Minimal working example:
import v8 from "v8";
import fs from "fs";
class MemoryProfiler {
takeSnapshot(filename: string): void {
const snapshot = v8.writeHeapSnapshot(filename);
console.log(`Heap snapshot saved to ${snapshot}`);
}
getMemoryUsage(): NodeJS.MemoryUsage {
return process.memoryUsage();
}
formatMemory(bytes: number): string {
return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
}
printMemoryUsage(): void {
const usage = this.getMemoryUsage();
Sponsors
Details
- Repository
- github.com/aj-geddes/useful-ai-prompts
- Categories
- AI & Agent Building, Debugging
- First seen
- Jun 3, 2026
More from aj-geddes/useful-ai-prompts
All 258- Database Backup Restore588
- Technical Roadmap Planning582
- Accessibility Testing580
- Push Notification Setup580
- Database Schema Documentation576
- App Store Deployment569
- Mobile App Debugging568
- Security Audit Logging568
- Bundle Size Optimization567
- Process Mapping563
- Oauth Implementation558
- Integration Testing557
- Memory Optimization552
- Semantic Versioning552
- Caching Strategy551
- Real Time Features548
- Web Performance Audit548
- Browser Debugging545
- Mobile Offline Support545
- Design System Creation543
- Gcp Cloud Run541
- Code Generation Template537
- Sql Injection Prevention533
- Grpc Service Development532