Dominator Tree: Unmasking JVM's Top Memory Hogs

This feature visualizes a hierarchical structure where an object 'dominates' another if all paths from GC roots to the latter pass through the former, effectively pinpointing the largest 'retained heap' and the true culprits of memory retention.

The top 3

  1. Top 3 Common JVM Memory Hogs Revealed by Dominator Trees: Dominator trees frequently unmask `java.util.HashMap` (or other collections), `String` objects, and `char[]` arrays as major memory consumers, often due to improper caching, long-lived strings, or large data buffers preventing garbage collection. In Android, `Activity` instances are also common culprits.
  2. Dominator Tree vs. Retained Heap Size: The Crucial Distinction: A dominator tree is a hierarchical structure representing object relationships, where an object 'dominates' another if all paths from GC roots to the latter pass through the former. 'Retained heap size' is the total memory freed if a dominant object is garbage collected, including its own shallow size and all exclusively retained objects. The dominator tree provides the visual structure to calculate and understand retained size.
  3. Top 3 Efficiency Boosts from Dominator Tree Analysis: Dominator trees significantly boost memory debugging by enabling: 1. **Prioritization:** Quickly identifying the largest memory leaks by their retained size. 2. **Root Cause Tracing:** Simplifying complex object graphs into clear paths to pinpoint what's preventing garbage collection. 3. **Impact Quantification:** Providing concrete data to demonstrate the memory savings from fixing specific issues.

Sources

Open the full topic