flutter_cached_network_image
flutter_cached_network_image copied to clipboard
App is crashing while loading an images by using the cached network image
I am using cache network image for displaying images but it is crashing every time while loading images and it is showing errors like the below.
thread https://github.com/flutter/flutter/pull/11, name = 'io.flutter.1.io', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=2098 MB, unused=0x0) frame #0: 0x00000001084d0e68 Fluttervoid downsample_2_2<ColorTypeFilter_8888>(void*, void const*, unsigned long, int) + 84 Flutterdownsample_2_2<ColorTypeFilter_8888>: -> 0x1084d0e68 <+84>: st1.s { v0 }[0], [x0], https://github.com/flutter/flutter/issues/4 0x1084d0e6c <+88>: subs x8, x8, #0x1 0x1084d0e70 <+92>: b.ne 0x1084d0e24 ; <+16> 0x1084d0e74 <+96>: ret Target 0: (Runner) stopped. thread https://github.com/flutter/flutter/pull/11, name = 'io.flutter.1.io', stop reason = EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=2098 MB, unused=0x0) frame #0: 0x00000002232e1aa8 libsystem_platform.dylib_platform_memmove + 88 libsystem_platform.dylib_platform_memmove: -> 0x2232e1aa8 <+88>: stnp q0, q1, [x3] 0x2232e1aac <+92>: add x3, x3, #0x20 0x2232e1ab0 <+96>: ldnp q0, q1, [x1] 0x2232e1ab4 <+100>: add x1, x1, #0x20
the same as you
Facing same issue.
the same as you ,100 pictures are easier
Any update on this?
same here.
I got these errors and
- using
Image
widget inimageBuilder
allow to avoid crash of the app on some http error during laoding - passing the
cacheWidth
andcacheHeight
to theImage
reduce the problem of memory by far. You should also look on the size of the images you are loading. - Avoid think like
shrinkWrap: true
orautomaticKeepAlive: true
for scrollviews . - I also see an error on this package that removes images from cache every 10 seconds that is marked as "old" (the package checks the header of the image to see if it's valid) so if the
maxAge
header is like NOW then the image will be erased from cache and rebuilding your widget will make another api call.
Hi, @all even I am facing the same issue, can anyone have a proper answer? for this issue.
Any update on this..?
Hi @maxusr, If we use cacheWidth and cacheHeight, It will resize the image, and the image quality will go.
same issue on our end, prepping for production release
Hey, did anyone found a proper solution to this problem?
I faced this issue and ended up replacing the package. The issue was due to memory leak when there's too many images to load and unload. I think the cache is not well handled (through a maxAge header for example that is NOW) causing the image to be reload everytime the widget is built rather than using only the one in cache.
Keeps crashing for me too
the same issue from our side also the crash when loading the image @BeMacized did you have any recommendation to avoid this crash ?
This image shows clearly the issue when we stop scrolling faster, the memory starts to increase until loading all images, and if it touches 2gb the app crashes. Probably there are multiple operations running for all images when we stop scrolling, even for the images that are not visible anymore.
Hey, did anyone found a proper solution to this problem ?????
I'm facing the same issue.
In my personal experience, the images in our DB were being uploaded way with a large size around 1-2MB. I was using the flutter ImagePicker plugin to store user photos and not resizing them using the plugin's maxHeight and maxWidth params. The large photos in a listview cause insane memory issues especially without pagination. Now the photos stored are never more than 50 KB and CachedNetwork image works perfectly. Been released on app store for 3 months now with no issues.
Let me know if this helps anyone!
https://apps.apple.com/us/app/circl-bring-people-together/id1610676363
Here's the app if anyone wants to check it out
memory crash can try this framework https://github.com/LianjiaTech/keframe it's worked for me!
memory crash can try this framework https://github.com/LianjiaTech/keframe it's worked for me!
@lyb5834, The below link is not working. https://github.com/LianjiaTech/keframe
@venkateshavenki why? i'v tried it, memory cache rising very slowly and safe
what about high res image in ios? https://github.com/flutter/flutter/issues/110331
same question
@venkateshavenki why? i'v tried it, memory cache rising very slowly and safe
Hi @lyb5834, Yes it is working for low-resolution images. However, we are encountering a memory issue when dealing with high-resolution images in ios.
Waiting for the big picture solution.