chrisbanes / Android-BitmapCache

Android-BitmapCache is a specialised cache, for use with Android Bitmap objects.
834 stars 224 forks source link

IllegalStateException: BitmapMemoryLruCache.sizeOf() is reporting inconsistent results! #22

Closed ashughes closed 11 years ago

ashughes commented 11 years ago

Sometimes I get an IllegalStateException when calling BitmapLruCache.getFromDiskCache(). I have both a disk and memory cache configured, and this call is successful most of the time.

Here's the stacktrace:

java.lang.IllegalStateException: uk.co.senab.bitmapcache.BitmapMemoryLruCache.sizeOf() is reporting inconsistent results!
at android.support.v4.util.LruCache.trimToSize
at android.support.v4.util.LruCache.put
at uk.co.senab.bitmapcache.BitmapMemoryLruCache.put
at uk.co.senab.bitmapcache.BitmapLruCache.getFromDiskCache
ashughes commented 11 years ago

Thanks Chris. I haven't run into the issue since the fix.

chrisbanes commented 11 years ago

Great, closing.