Skip to content
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

OOM issues with lots of image and scrolling #1104

Closed
aasiddiq opened this issue Aug 10, 2015 · 1 comment
Closed

OOM issues with lots of image and scrolling #1104

aasiddiq opened this issue Aug 10, 2015 · 1 comment

Comments

@aasiddiq
Copy link

Hi
I have two tabs with scrollview and 2 columns of images in both. I use Picasso to load the images here. I am getting OOM after a while of scrolling through the app. I have set LRU cache to 5MB

Here is the logs I get http://pastebin.com/fqCWUvfU
I am not sure how do I set a limit to using memory cache, so that whenever that limit is reached it will clear the cache so app does not crash

Thanks

@JakeWharton
Copy link
Member

Picasso, while often burdened by being the straw that breaks the camel's back in terms of memory and OOMs, is basically never the actual cause of the problem. The library is dutifully trying to load the images you tell it at the size you tell it (either implicitly or explicitly). Your app has pathological memory problems that caused the heap to fill and images no longer are able to fit.

Try something like LeakCanary to see if you have memory leaks, or do general memory cleanups like using smaller original images and .fit() to size them, use RGB_565 for photos to halve their memory requirements, and in general use more memory efficient data structures such as those provided by the support libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants