android-smart-image-view icon indicating copy to clipboard operation
android-smart-image-view copied to clipboard

Out of Memory Error

Open rhychel opened this issue 12 years ago • 1 comments

Have you tried it using inside an adapter for listview? It seems that your code is not optimized for loading a lot bitmaps. You may decode the result bitmap from the available Heap memory allocated for the app.

rhychel avatar Jan 24 '13 02:01 rhychel

I think should change memory cache to recommended LruCache class. From Google:

In the past, a popular memory cache implementation was a SoftReference or WeakReference bitmap cache, however this is not recommended. Starting from Android 2.3 (API Level 9) the garbage collector is more aggressive with collecting soft/weak references which makes them fairly ineffective. In addition, prior to Android 3.0 (API Level 11), the backing data of a bitmap was stored in native memory which is not released in a predictable manner, potentially causing an application to briefly exceed its memory limits and crash.

ipeisong avatar Apr 09 '13 22:04 ipeisong