Repository navigation
High images RAM consumption #44510
Copy link
Copy link
Closed
Labels
a: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.customer: googleVarious Google teamsVarious Google teamsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.perf: memoryPerformance issues related to memoryPerformance issues related to memory
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: imagesLoading, displaying, rendering imagesLoading, displaying, rendering imagesc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.customer: googleVarious Google teamsVarious Google teamsengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.perf: memoryPerformance issues related to memoryPerformance issues related to memory
Activity
alectogeek commentedon Nov 9, 2019
related #32156
iapicca commentedon Nov 11, 2019
Hi @alectogeek
does this solution work for you?
Thank you
#32156
alectogeek commentedon Nov 11, 2019
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?
iapicca commentedon Nov 11, 2019
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
alectogeek commentedon Nov 11, 2019
Thanks for answer @iapicca. Is there any "forecast" of when it will be solved? Can I help somehow?
alectogeek commentedon Nov 30, 2019
Is there any news?
dnfield commentedon Jan 9, 2020
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.
github-actions commentedon Aug 17, 2021
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 -vand a minimal reproduction of the issue.