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

1

7

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

Hydrolytic answered 28/10, 2015 at 19:21 Comment(0)
K
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.

Keynote answered 28/10, 2015 at 19:26 Comment(2)
So it looks like dominating size and retained heap are synonymsLipman
My comment is a little wrong: here is what the documentation says about dominating size and retained heap: developer.android.com/studio/profile/am-hprof.htmlLipman

© 2022 - 2024 — McMap. All rights reserved.