Android: Bitmap recycle() how does it work? -
lets have loaded image in bitmap object like
bitmap mybitmap = bitmapfactory.decodefile(myfile);
now happen if load bitmap like
mybitmap = bitmapfactory.decodefile(myfile2);
what happens first mybitmap garbage collected or have manually garbage collect before loading bitmap , eg. mybitmap.recycle()
also there better way load large images , display them 1 after recycling on way
the first bitmap not gc'ed when decode second one. gc later whenever decides. if want free memory asap should call recycle() before decoding second bitmap.
if want load big image should resample it. here's example strange out of memory issue while loading image bitmap object.
Comments
Post a Comment