Skip to main content
InterviewHubPRO
Section Overview
Q26

Question 26 of 50

Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

52%
Web Vitals & Performance (50 Qs)•Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)

Profiling Frontend Memory Leaks in Chrome DevTools.

senior LevelPerformanceMemory ManagementSystem Design

In Simple Words: Memory leaks cause browser tabs to consume gigabytes of RAM, triggering garbage collection thrashing that cripples INP:

  1. Three Snapshot Technique:
    • Take Heap Snapshot 1.
    • Perform action (e.g. Open & Close Modal).
    • Take Heap Snapshot 2.
    • Perform action again.
    • Take Heap Snapshot 3.
  2. In Snapshot 3, filter by Objects allocated between Snapshot 1 and 2.
  3. Inspect Retaining Tree to find references preventing GC (e.g. uncleared intervals, unremoved global event listeners, detached DOM nodes).