Dominator Tree: Unmasking True Memory Hogs

This view highlights objects that exclusively retain the largest portions of heap memory, revealing the precise reference chains preventing garbage collection and pinpointing the actual leak source.

The top 3

  1. Dominator Tree vs. Shallow Heap: Why It Matters for OOM: Unlike shallow heap, the dominator tree reveals an object's *retained size*, showing the total memory that would be reclaimed if that object and its dominated subtree were garbage collected, pinpointing the true leak culprit.
  2. Critical Metrics: Retained vs. Shallow Size in Dominator Tree: The 'retained size' is paramount in a dominator tree, indicating the total memory an object *keeps alive* indirectly, often vastly different from its 'shallow size,' which is just its own direct memory footprint.
  3. Top 3 Memory Leak Scenarios Unmasked by Dominator Tree: The dominator tree effectively exposes common OOM culprits like forgotten listeners, excessive caching mechanisms, or static collections holding onto large object graphs, making it indispensable for leak diagnosis.

Sources

Open the full topic