After dumping heap in Android Studio and viewing the created snapshot, there's a field called "dominating size".
What does it stand for?
Asked
Active
Viewed 2,004 times
7
1 Answers
7
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.

Snild Dolkow
- 6,669
- 3
- 20
- 32
-
So it looks like dominating size and retained heap are synonyms – Maksim Dmitriev Jan 07 '17 at 17:47
-
My comment is a little wrong: here is what the documentation says about dominating size and retained heap: https://developer.android.com/studio/profile/am-hprof.html – Maksim Dmitriev Jan 07 '17 at 19:25