Android-BitmapCache icon indicating copy to clipboard operation
Android-BitmapCache copied to clipboard

Frequently getting the error of "java.lang.OutOfMemoryError" exception

Open linxingyun opened this issue 12 years ago • 0 comments

Hello, I am frequently getting the OOME exception when using this lib to view pictures from server. Here is the exception callback:

07-17 23:00:01.230: E/AndroidRuntime(10272): Caused by: java.lang.OutOfMemoryError 07-17 23:00:01.230: E/AndroidRuntime(10272): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 07-17 23:00:01.230: E/AndroidRuntime(10272): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:493) 07-17 23:00:01.230: E/AndroidRuntime(10272): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:299) 07-17 23:00:01.230: E/AndroidRuntime(10272): at uk.co.senab.bitmapcache.BitmapLruCache.put(BitmapLruCache.java:425)

Note that the "mDecodeOpts" is setting as below: if (!fullSize) { decodeOpts = new BitmapFactory.Options(); decodeOpts.inDensity = DisplayMetrics.DENSITY_XHIGH; decodeOpts.inPurgeable = true; decodeOpts.inInputShareable = true; decodeOpts.inScaled = true; }

Thanks in advance for any comment or suggestion!

linxingyun avatar Jul 17 '13 15:07 linxingyun