-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Out of Memory Error : Recycle? #20
Comments
Sorry for a delay, too busy these days. 2012/10/4 shaunidiot notifications@github.com
|
I was having the same issues, specifically on the Motorola DroidX2 which has a 32mb heap limit AND is running Gingerbread......however.... I changed the Map instance of the cache object in the MemoryClass.java file to use a SoftReference to bitmaps like so:
Now I'm able to load up over 300 images all of great quality. Obviously all calls to get() and put() needed to be modified to account for the change to SoftReference, but it's working great now. I'm a noob, so if I'm dead wrong on this my apologies, but I thought I should let you know of my findings just in case it could help others. Thank you for this library! It's awesome!
|
SoftReferences are not recommended to be used on Android. They may be cleared too fast and you'll get no cache at all, image will be parsed from SD each time. I had this problem before that's why I switched to my own MemoryCache implementation. By default MemoryCache uses 25% of available memory. You can try to use less to have more free memory. |
Dear thest1, |
hi @thest1 this is my app,it's work in progress and i am unsure if this is the way lazyload performs you will really like the app and i will mention your name on my company's website https://www.dropbox.com/s/t7uoudwq30i58kx/LazyList.rar I have a website under construction |
Laggy scroll usually means you're inflating new view in every getView() call or decode bitmap in every getVIew() call. Please investigate what exactly is happening when you scroll. |
Dear thest1 |
I used SoftReference and everything's ok now. However, I want to get the solution from Thest1 |
I have the same issue, |
Please forgive me for my noob-ness in Android programming. Just learnt Java weeks ago.
I've been using Lazylist to load images from website. However, I've been getting OOM error.
I searched it up on Stackoverflow and realized that recycle is needed so that space can be allocated for more images.
I looked it up on ImageLoader and this (recycle) wasn't implemented. I tried to code it myself yet faced with lots of error [bitmap.recycle()]. May I ask if this is possible?
Furthermore, in the listview, one image doesn't cause an error, yet when I add textview etc, it caused the OOM error too.
Thanks!
The text was updated successfully, but these errors were encountered: