About Memory Leak Detector

A free, framework-agnostic Chrome DevTools extension for finding and fixing memory leaks in any web application.

Overview

Memory Leak Detector is a Chrome DevTools extension designed for web developers who care about performance. It monitors your web application in real-time and identifies four types of memory leaks — event listeners that accumulate without cleanup, timers that run indefinitely, DOM nodes that are removed but held in memory, and abnormal heap growth patterns.

It works with React, Vue, Angular, Svelte, vanilla JS, and any framework — no configuration required. Simply install, click Start, and use your app normally.

Detection Capabilities

Event Listener Tracking

Monkey-patches addEventListener/removeEventListener to track which listeners are added but never removed. Records stack traces with exact file:line:column.

Timer Tracking

Detects setInterval/setTimeout calls that run indefinitely without cleanup. Flags intervals running longer than 5 minutes and auto-cleans resolved timeouts.

Detached DOM Nodes

Uses WeakRef to track removed DOM nodes. If a node isn't garbage collected after 10 seconds and not reattached to the DOM, it's flagged as a potential leak.

Heap Growth Analysis

Samples performance.memory every 3 seconds. Compares recent samples versus prior samples and flags growth rates above 15% as suspicious, above 30% as critical.

How It Works

1

Click the extension icon or open DevTools and navigate to the Memory Leaks tab

2

Click "Start" to begin monitoring your web application

3

Use your web app normally — navigate, interact, trigger state changes

4

View detected leaks with exact source locations and full stack traces

5

Fix the leaks and verify they're resolved with a fresh scan

What's Included

DevTools Panel

  • Stats bar — heap used/total, listener count, timer count, detached nodes
  • Timeline tab — real-time Chart.js graphs for memory usage & resource tracking
  • Leaks tab — filterable list by type and severity with expandable stack traces
  • Listeners tab — grouped view of all tracked event listeners with source locations

Extension Popup

  • Health ring — score 0-100 based on detected leak count
  • Quick stats — heap usage, leaks, listeners, timers at a glance
  • Leak preview — top 5 most recent issues
  • Start/Stop controls for monitoring sessions

Technical Details

Manifest

V3 (latest)

Build Step

None — pure vanilla JS

Charts

Chart.js (bundled locally)

DOM Tracking

WeakRef (leak-safe)

Theme

Dark (matches DevTools)

Frameworks

All — framework-agnostic

Key Design Decisions

Manifest V3

Required for new Chrome Web Store submissions and future-proofing.

Page-context injection

detector.js runs in the page context (not content script sandbox) so it can monkey-patch native APIs like addEventListener and setInterval.

WeakRef for DOM tracking

Avoids the detector itself causing memory leaks when tracking detached DOM nodes.

No build step

Pure vanilla JS that loads directly — no bundler, no transpiler, no dependencies beyond Chart.js.

Chart.js bundled locally

MV3 Content Security Policy blocks CDN scripts, so Chart.js is included in the extension package.

Dark theme

Matches the Chrome DevTools aesthetic for a seamless developer experience.