memory-leak-detector

Detect memory leaks in desktop applications through heap analysis and object tracking

509 stars

Best use case

memory-leak-detector is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Detect memory leaks in desktop applications through heap analysis and object tracking

Teams using memory-leak-detector should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/memory-leak-detector/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/desktop-development/skills/memory-leak-detector/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/memory-leak-detector/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How memory-leak-detector Compares

Feature / Agentmemory-leak-detectorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Detect memory leaks in desktop applications through heap analysis and object tracking

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# memory-leak-detector

Detect memory leaks in desktop applications through heap snapshot analysis, object tracking, and growth pattern detection.

## Capabilities

- Capture and compare heap snapshots
- Track object allocation growth
- Identify retained objects
- Detect common leak patterns
- Generate leak reports
- Suggest fixes

## Input Schema

```json
{
  "type": "object",
  "properties": {
    "projectPath": { "type": "string" },
    "framework": { "enum": ["electron", "native", "qt"] },
    "duration": { "type": "number", "default": 60 }
  },
  "required": ["projectPath"]
}
```

## Detection Approach

```javascript
// Heap snapshot comparison
const v8 = require('v8');

function detectLeaks(iterations = 3, intervalMs = 10000) {
  const snapshots = [];

  const interval = setInterval(() => {
    global.gc(); // Requires --expose-gc
    const snapshot = v8.getHeapStatistics();
    snapshots.push(snapshot);

    if (snapshots.length >= iterations) {
      clearInterval(interval);
      analyzeGrowth(snapshots);
    }
  }, intervalMs);
}

function analyzeGrowth(snapshots) {
  const growth = snapshots[snapshots.length - 1].used_heap_size -
                 snapshots[0].used_heap_size;
  console.log(`Heap growth: ${growth / 1024 / 1024} MB`);
}
```

## Common Leak Patterns

1. Event listeners not removed
2. Closures holding references
3. Global variable accumulation
4. Timer/interval not cleared
5. DOM node detachment

## Related Skills

- `electron-memory-profiler`
- `startup-time-profiler`

Related Skills

homoglyph-detector

509
from a5c-ai/babysitter

Byte-level Unicode homoglyph detection for identifying invisible character substitutions in code

Memory Allocator

509
from a5c-ai/babysitter

Expert skill for custom memory allocator design optimized for language runtime needs

unified-memory

509
from a5c-ai/babysitter

Expert skill for CUDA Unified Memory and memory prefetching optimization. Configure managed memory allocations, implement memory prefetch strategies, handle page fault analysis, configure memory hints and advise, profile unified memory migration, optimize for oversubscription scenarios, and compare managed vs explicit memory.

gpu-memory-analysis

509
from a5c-ai/babysitter

Specialized skill for GPU memory hierarchy analysis and optimization. Analyze memory access patterns, detect bank conflicts, optimize cache utilization, profile global memory bandwidth, and generate optimized memory access code patterns.

memory-interfaces

509
from a5c-ai/babysitter

Expert skill for on-chip and external memory interface design in FPGAs

memory-analysis

509
from a5c-ai/babysitter

Embedded memory analysis, optimization, and leak detection

geant4-detector-simulator

509
from a5c-ai/babysitter

Geant4 detector simulation skill for particle transport, detector geometry, and physics process modeling

memory-model-analyzer

509
from a5c-ai/babysitter

Analyze programs under various memory models for concurrent correctness

structural-variant-detector

509
from a5c-ai/babysitter

Structural variant detection skill for identifying CNVs, inversions, translocations, and complex rearrangements

fusion-gene-detector

509
from a5c-ai/babysitter

Gene fusion detection skill for oncology applications with multiple caller integration

electron-memory-profiler

509
from a5c-ai/babysitter

Profile Electron app memory usage, detect leaks, analyze renderer process memory, and optimize memory consumption

fairlearn-bias-detector

509
from a5c-ai/babysitter

Fairness assessment skill using Fairlearn for bias detection, mitigation, and compliance reporting.