-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak: App crashes when it load more than 300 WebP images #622
Comments
Upgrade the SDWebImageWebPCoder to v0.5.0 should fix this issue. See SDWebImage/SDWebImageWebPCoder#29 This is not a memory leak, but just the memory usage is high. |
This improves RAM usage for static webp assets (see SDWebImage/SDWebImageWebPCoder#30) Potentially related to DylanVann#622
@dreampiggy is this fixes in the latest version of NPM? I still get huge spikes in memory usages |
@klaaz0r Doesn't this issue been fixed ? In the 0.5.0 we optimize the Static WebP images, which does not cause double RAM usage. (previously it allocate the same size |
If you already use tons of WebP images and Animated WebP, maybe this 0.5.0 upgrade does not fix the issue from stratch (Only can help to reduce memory pressure). Because bitmap image always need RAM to allocate, this can not been avoid. You can try to limit your image size, by changing the original image (let your image server provider to provide a smaller size). Or you can use the thumbnail decoding feature. See: Thumbnail Decoding. But those feature only available in iOS native code, there are no React JavcScript bridge currently... |
@dreampiggy I think the problem I am having is caused by something else, I did some comparison and loading in a few hundred images inside a flatlist didn't result in any problems. Memory spikes occurred when image urls got a 404 (or any other non-200). |
@klaaz0r Can you provide a demo to show the 404 case that cause OOM ? For iOS part of reat-native-fast-image (using SDWebImage), once a image url was returned 404, it will be blacked list (until you disbale this feature), next time this url will immediately fail. Even you disable black list, this does not cause Bitmap allocation which result so huge RAM usage. I guess there are some leak in here. |
@dreampiggy I will create a repo with some examples showing what happens! If you want to quickly test it yourself you can try to add some dead links/link responding with text inside the examples |
This improves RAM usage for static webp assets see: SDWebImage/SDWebImageWebPCoder#30 Potentially related to #622
@aibrahim3546 @klaaz0r See changelog: SDWebImage 5.7.2 version released. I think this solve some OOM issue for large number of images using in |
This improves RAM usage for static webp assets see: SDWebImage/SDWebImageWebPCoder#30 Potentially related to DylanVann#622
Might be fixed by latest updates to SDWebImage (thanks @dreampiggy). Give it a shot. If not open a new issue. Thank you! |
Looks like the issue still exists. Created the new issue #738 |
This improves RAM usage for static webp assets see: SDWebImage/SDWebImageWebPCoder#30 Potentially related to DylanVann/react-native-fast-image#622
Describe the bug
I am using a WebP image. the memory get so hight up to 1gb when i try to load more that 300 image. And end up crashing the app because of out of memory.
To Reproduce
Try to load more than 300 WebP images.
Expected behavior
Memory doesn't leak and wont crash the app. Are there anyway that i can clear the memory?
Dependency versions
The text was updated successfully, but these errors were encountered: