Is Glide can automatic clean cache?
I use Glide to load bitmap in RecyclerView, but I found the head size will increase, and the head size don't stable a certain level. It will oom?I want to ask that Glide will auto clean memory cache? (My English is pool,sorry.)
It is subscribed to onLowMemory events, so the memory cache is pruned when the system asks for it.
Please note that if you display too many or large images cleaning the memory cache won't really help.
If memory pool (not cache) size increases it probably indicates that Glide cannot reuse Bitmaps because they are of different size, try to unify ImageView sizes in the list in this case.
If memory usage just increases over time, it's likely that you have a memory leak in your application. Glide's memory cache and Bitmap pool both have fixed sizes, so even if you're not getting good hit rates in either, memory usage is still size bound.
@sjudd hi, I also use Volley to load bitmap,the memory usage is stable a certain level(almost 30M). But if I use Glide, it will increases(almost 50M). Will Glide clean memory usage if bitmap memory usage is over a someone level?
@TWiStErRob hi Glide.with(mContext).load(imageUrl).crossFade().override(114,114).into(imageView); This is how I use Glide in my app.I had set a certain sizes of bitmap. And imageView‘s property in xml is : android:layout_width="match_parent" android:layout_height="80dp" android:adjustViewBounds="true" android:scaleType="centerCrop"
As mentioned above, Glide uses fixed size memory pools/caches so Glide's memory usage is capped. Glide's memory use is also reduced when memory ComponentCallbacks are called.
It's also entirely possible, and even probably that Glide uses more memory than Volley by default. If you'd like to reduce Glide's memory usage, see the Configuration page.
Again if your memory usage appears to be unbounded, I'd suspect a memory leak.
@sjudd thinks!