Skip to content

Fixing leaks overview

Fixing = break the unexpected retention path + prevent recurrence.

Leak Fix
Global store Module scope → bounded cache or external store with TTL
Timer Store id, clearInterval on teardown
Listener removeEventListener or AbortController
DOM Don’t hoard elements; null refs in arrays
Closure Minimize captured scope
Cache LRU + max size
  1. Re-run reproduction soak test
  2. Snapshot diff — delta should plateau
  3. Monitor staging 24–48h before prod