LruMemoryCache和LruCache
#LruMemoryCache和LruCache 在UniversalImageLoader中缓存在内存中的数据就使用了LruCache类,叫LruMemoryCache,存在内存中的图片就是放在该类中了,想想早年我们用软引用的方式保存,也是弱爆了... Lru Lru(Least recently used,最近最少使用)是一个缓存淘汰算法的简写,如果数据长时间没有被访问,那么缓存数据容量满的的时候,将会淘汰最少使用的数据。 我们直接看LruMemoryCache的代码。 /** * A cache that holds strong references to a limited number of Bitmaps. Each time a Bitmap is accessed, it is moved to * the head of a queue. When a Bitmap is added to a full cache, the Bitmap at the end of that queue is evicted and may * become eligible for garbage collection.<br /> * <br /> * <b>NOTE:</b> This cache uses only strong references for