android - How much memory is allocated to this Bitmap? -


i'm not quite sure how memory allocated following variable "bitmap",

bitmap bitmap = bitmapfactory.decoderesource(getresources(), r.mipmap.example); bitmap = bitmap.createscaledbitmap(bitmap, 100, 100, true); 

say, dimension of original image 1024*768 , memory has been allocated bitmap. bitmap scaled 100*100, , memory allocated variable "bitmap" changed due change of dimension?

a variable ever takes small amount of memory (if any). few bytes @ most. variable of object type uses enough memory store pointer object.

objects pointed variables, however, can take amount of memory. createscaledbitmap creates new bitmap after code run there 2 bitmaps in memory. 1 of them (the original, larger one) no longer has live references (e.g. variables) pointing it, garbage collected.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -