Retainers and dominators
In a heap snapshot, select an object instance → Retainers tab shows why it’s alive.
Retainer chain example
Section titled “Retainer chain example”Window / global └── leakStore (Array) └── (elements) └── Object @12345 ← your leaked instanceRead bottom-up: the leaf is the victim; the top is the root keeping it alive.
Dominators
Section titled “Dominators”Dominator tree — if you removed this object, which other objects would become unreachable?
High retained size + small shallow size = likely collection holding many children (array of DOM nodes, cache Map).
flowchart BT obj[Leaked Object] arr[Array cache] global[global] obj --> arr arr --> global
Shallow vs retained
Section titled “Shallow vs retained”| Term | Meaning |
|---|---|
| Shallow size | Object’s own bytes |
| Retained size | Bytes freed if object is removed |
Sort by Retained size to find the biggest wins.
Practical tip
Section titled “Practical tip”Search snapshot for your domain object (UserSession, ChartWidget). One retained instance is normal; monotonic instance count under repeated actions is the leak.