Reproduce reliably
You cannot debug what you cannot trigger.
Checklist
Section titled “Checklist”- Minimal path — smallest UI flow or API sequence that grows memory
- Fixed workload — same payload size, same loop count
- Disable noise — extensions off, other tabs closed (browser)
- Soak duration — leaks may need 10–30 min to separate from noise
- Record environment — Chrome version, Node version, build flags
Browser reproduction script
Section titled “Browser reproduction script”async function soak(iterations = 100) { for (let i = 0; i < iterations; i++) { await openAndCloseModal(); // your suspect flow if (i % 10 === 0 && performance.memory) { console.log(i, performance.memory.usedJSHeapSize); } }}Node reproduction
Section titled “Node reproduction”Use the examples/node/*-leak.js scripts — they loop forever with logging.
node --expose-gc examples/node/01-global-array-leak.js 2>&1 | tee leak.logDocument the hypothesis
Section titled “Document the hypothesis”| Field | Example |
|---|---|
| Action | Navigate Dashboard → Settings 50× |
| Expected | Heap returns to ~baseline |
| Actual | +3 MB per cycle |
| Suspect | Router listener not removed |