Skip to content

High images RAM consumption #44510

Closed

Description

@alectogeek

I'm working on an app (mainly for iOS) that contains ListView.builder with lots of pictures (about 64 pictures, 7.7 Mb size in total on disk) and I have a huge performance problem on devices with 1 Gb RAM and lower. I tried to decrease imageCache _maximumSizeBytes to 30 Mb and now the app works better in terms of smoothness but it's bad workaround because now pictures are uploaded from the cache and it leads to freezes in pictures appearing in the list.

I'm sure I'm facing the same problem as in #13242. Any suggestions/ideas?

Flutter doctor

[✓] Flutter (Channel master, v1.10.16-pre.88, on Mac OS X 10.14.6 18G103, locale en-RU)
    • Flutter version 1.10.16-pre.88 at /Users/alectogeek/Documents/Programs/flutter
    • Framework revision ff95b14ad8 (30 hours ago), 2019-11-07 23:14:17 -0500
    • Engine revision 7ed9c9fc58
    • Dart version 2.7.0

 
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/alectogeek/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.1, Build version 11A1027
    • CocoaPods version 1.8.0

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 39.0.3
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

Activity

  1. alectogeek commented on Nov 9, 2019

    @alectogeek
    Author

    related #32156

  2. iapicca commented on Nov 11, 2019

    @iapicca

    Hi @alectogeek
    does this solution work for you?
    Thank you

    #32156

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 11, 2019
  4. alectogeek commented on Nov 11, 2019

    @alectogeek
    Author

    Hi @iapicca! Thanks for the answer. No, I need to show almost the whole image, so I need to cache the whole image as well. Moreover, I use CachedNetworkImage absolutely everywhere and this package doesn't support cacheHeight/cacheWidth parametres. But.. is it normal that decoded image takes 10+ times more space in RAM than it took being encoded in local storage?

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 11, 2019
  6. added
    a: imagesLoading, displaying, rendering images
    engineflutter/engine related. See also e: labels.
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: performanceRelates to speed or footprint issues (see "perf:" labels)
    on Nov 11, 2019
  7. iapicca commented on Nov 11, 2019

    @iapicca

    Hi again @alectogeek
    the high ram consumption is a known situation
    as you can see from the cases listed in this issue,
    thank you for your contribution

  8. alectogeek commented on Nov 11, 2019

    @alectogeek
    Author

    Thanks for answer @iapicca. Is there any "forecast" of when it will be solved? Can I help somehow?

  9. alectogeek commented on Nov 30, 2019

    @alectogeek
    Author

    Is there any news?

  10. added
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Dec 13, 2019
  11. self-assigned this
    on Jan 9, 2020
  12. added this to the milestone on Jan 9, 2020
  13. dnfield commented on Jan 9, 2020

    @dnfield
    Contributor

    I think I have a fix for this, assuming it's similiar to the issue in #32143 (where rapid scrolling makes it particularly bad).

    If you're worried that images are taking up a lot of memory statically, that's a different bug than what I'm thinking though.

  14. github-actions commented on Aug 17, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.customer: googleVarious Google teamsengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.perf: memoryPerformance issues related to memory

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions