Image heavy applications have to decode many images, so there will be continuous allocation and deallocation of memory in application. This results in frequent calling of the Garbage Collector (GC). And if you call the GC too many times, your application UI freezes. Glide , Fresco and Android Networking all use the Bitmap Pool Concept to load images efficient By using the Bitmap pool to avoid continuous allocation and deallocation of memory in your application, you reduce GC overhead, which results in a smooth-running application. One way to do this is to use inBitmap (which reuses bitmap memory). Suppose we have to load few bitmaps in an Android application. When we load bitmapOne, it will allocate the memory for bitmapOne. Then if when we no longer need bitmapOne, do not recycle the bitmap (as recycling involves calling GC). Instead, use this bitmapOne as an inBitmap for bitmapTwo. This way, the same memory can be reused for bitmapTwo. B...
Comments
Post a Comment