The active interval keeps its callback reachable, and the callback closes over `data`.
Heap usage grows after repeated navigation, polling, subscriptions, cache writes, or background work. Clear polling intervals in React effects, widgets, and background refresh loops.
Forgetting to clear intervals on unmount or teardown.
Remove long-lived references, clear timers/listeners, and verify the object can be collected.
const id = setInterval(tick, 1000); return () => clearInterval(id);
The visual proof is the active runtime event: watch what is retained, blocked, queued, or released at each step.
Repeat the workflow several times, take a heap snapshot, and confirm retained listeners, timers, or cached objects stop growing after cleanup.
Related cases
Continue with nearby confusion while the mental model is fresh.
event listener leak
Clean up window, document, and shared element listeners in component lifecycles.
closure memory hold
Closures are useful for caches and private state, but can accidentally retain large objects.
cache growth
Use LRU, TTL, explicit invalidation, or WeakMap when appropriate.
Was this clear?
This stays local for now. It helps you track where the product still needs sharper cases.