androidandroid-studiohprof

Android Studio heap snapshot analyzer - what does "Dominating size" represent?


After dumping heap in Android Studio and viewing the created snapshot, there's a field called "dominating size". What does it stand for? enter image description here


Solution

  • That's the size of that object + everything it keeps alive by direct or indirect references.

    I'm not sure about Android Studio, but generally, "dominating" would mean that you only count the objects that are only accessible through your Bitmap objects here -- i.e., if your Bitmap is freed, all of those objects could be freed as well.

    In your case, each Bitmap object itself only takes 60 bytes -- but they each have a (separately allocated) pixel buffer of some kind that they're keeping alive.