Code Monkey home page Code Monkey logo

Comments (5)

srvrguy avatar srvrguy commented on August 27, 2024

Everything I read claims that a ListView would appear to be the proper solution for this issue as it automatically recycles elements. However, Google talks about the grid list building block, which is basically what the application is trying to do.

It seems GridLists can recycle resources if handled correctly. It might be worthwhile to try to investigate the code discussed here as a possible solution to the memory issue and also as a chance to make the application feel more responsive.

from atarashii.

AnimaSA avatar AnimaSA commented on August 27, 2024

GridView actually does recycle its elements, the same way that ListView does, they both extend from AbsListView. I think the problem however is that the ImageDownloader class (which also handles saving and serving preloaded images) keeps an internal cache loaded in memory. Whole this helps performance after the images are initially out into the cache, the cache becomes too big and an OOM exception is thrown.

Ergo, the ImageDownloader needs to be made to release resources.

from atarashii.

srvrguy avatar srvrguy commented on August 27, 2024

That does make more sense than what I posted.

from atarashii.

AnimaSA avatar AnimaSA commented on August 27, 2024

The second link you posted is pretty good though, it reminded me that WeakReferences exist, which could probably fix the problem. (Another thing I never actually thought I'd use, how 'bout that!)

from atarashii.

AnimaSA avatar AnimaSA commented on August 27, 2024

Should be resolved as of 2a2c1fa, closing

from atarashii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.