GithubHelp home page GithubHelp logo

Out of Memory issue about shimmer-android HOT 10 CLOSED

facebook avatar facebook commented on April 20, 2024 1
Out of Memory issue

from shimmer-android.

Comments (10)

guntherhoppe avatar guntherhoppe commented on April 20, 2024 5

I faced a similiar issue while using ShimmerFrameLayout with RecyclerView (without any ImageView). While loading adapter data I display a few preview items with ShimmerFrameLayout. They are replaced after loading finished. Each time they were displayed increased the memory consumption permanently (never released). After some time / view changes an OutOfMemoryError occurs.

The basic problem here was that the internal created bitmaps of ShimmerFrameLayout are not recycled by itself. So they remain in memory.

To solve my issue I overwrote the onViewRecycled method in RecyclerView.Adapter. I simply call the useDefaults method there which internally do recycle the bitmaps (via resetAll). Actually there is no public dispose / recycle / reset method available in ShimmerFrameLayout.

from shimmer-android.

varunrramani avatar varunrramani commented on April 20, 2024

I'm using a 900x900 png with shimmer layout which is displayed in 250dp by 250dp imageview.

from shimmer-android.

onuryurtturk avatar onuryurtturk commented on April 20, 2024

same issue with lower png resolution. Anyone?

from shimmer-android.

feresr avatar feresr commented on April 20, 2024

+1 same problem here

from shimmer-android.

jagwanti avatar jagwanti commented on April 20, 2024

I am also facing the same problem. I am using simple linear layouts in Shimmer layout.

from shimmer-android.

jbmlaird avatar jbmlaird commented on April 20, 2024

Thanks @guntherhoppe

from shimmer-android.

barnhill avatar barnhill commented on April 20, 2024

Confirmed this issue in our app as well ... if useDefaults isnt called and you have quite a few shimmers on the screen and you leave and come back to the same screen enough the memory usage balloons and the app will crash from an OOM exception

from shimmer-android.

ClaudeHangui avatar ClaudeHangui commented on April 20, 2024

Please can you post some code ??
What do you mean by useDefaults ??? Is that a method of recyclerview ??

from shimmer-android.

barnhill avatar barnhill commented on April 20, 2024

Nah its a method on the shimmerFrameLayout ... we have added a global layout listener to reset this at the proper time in our current code. Im hoping we could provide this back to the community but it looks like this library is no longer being maintained

from shimmer-android.

xiphirx avatar xiphirx commented on April 20, 2024

544c568

from shimmer-android.

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.