Skip to main content

Dominators and shared references

A dominates B if every retaining path from the synthetic root to B passes through A. The immediate dominator is the nearest such ancestor; it need not directly reference B.

Same objects, different relationships
Actual object referencesRoot points to Owner. Owner points to Second and Payload; Second also points to the same Payload.RootOwnerSecondPayloadArrows are references. Payload is rendered once.

Owner dominates Payload even though Second also references it. Domination is not a direct-field relationship.

Owner references Payload directly and through Second. Owner dominates both, but Second does not dominate Payload because a route bypasses Second. A tree omits the actual Second → Payload reference.

Retained bytes​

Retained size is shallow size plus the modeled shallow bytes of the dominator subtree. It is a graph counterfactual—not a promise that deleting one variable implements that object removal in live code.

Illustrative example, not a benchmark:

ObjectShallow bytesRetained bytes
Owner241,048,624
Second2424
Payload1,048,5761,048,576

Owner's total already includes the other two objects. Adding retained totals double-counts Payload. Another independent root to Payload would change Owner's retention.

Investigation​

Expand Dominator Tree, then use Inspect, Show referrers, and Why alive. A large bounded cache may be expected. Its owner class is not necessarily the repair location.

Dominators are computed before UI expansion. Lazy child loading reduces rendering work, not initial graph RAM. Initial displayed top entry points need not be a disjoint partition of root children. See size semantics.