Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 778
Guy Avatar asked Oct 28 '15 19:10

Guy


1 Answers

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.

like image 91
Snild Dolkow Avatar answered Nov 16 '22 16:11

Snild Dolkow