Skip to content

OOM issues with lots of image and scrolling #1104

Closed
@aasiddiq

Description

@aasiddiq

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

Activity

JakeWharton

JakeWharton commented on Aug 11, 2015

@JakeWharton
Collaborator

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @JakeWharton@aasiddiq

        Issue actions

          OOM issues with lots of image and scrolling · Issue #1104 · square/picasso