I'm using the glide library in my app for displaying bitmap (from asset and from url). It works well but I get somme Out of memomy issues as I'm displaying a lot of images in each activities. I see I can use the clearMemory() from BitmapPool, but I have no clue how to call it..
Is someone know how to call it?
Thanks
You can use clearMemory()
or trimMemory()
to clear both Glide's memory cache and bitmap pool:
Glide.get(context).clearMemory()
// or:
Glide.get(context).trimMemory(ComponentCallbacks2.TRIM_MEMORY_MODERATE);
That said, you shouldn't need to do either. Two things to check:
override()
API on your request. Doing so in conjunction with a Transformation like fitCenter
will help reduce the memory used per image.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With