Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Take heap snapshots before and after repeated navigation, compare retained objects and detached DOM nodes, then look for subscriptions, timers, global listeners and caches that hold references after components unmount.
Reproduce the growth by repeating a navigation cycle several times, forcing garbage collection, and comparing heap snapshots in Chrome DevTools. Detached DOM trees and growing counts of component-related objects point to what is retained, and the retainers panel shows who holds them. Typical causes are effects without cleanup for listeners, intervals or subscriptions, module-level caches or arrays that grow forever, closures stored in global singletons such as analytics or event buses, and third-party widgets that are never destroyed. Fix the owner of the reference, add cleanup, bound caches with size limits or WeakMap, and add a repeatable test or measurement to prevent regressions.