Skip to content
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

App crashes when load many images from firestore - swift #2418

Closed
3 tasks done
SamboVisal opened this issue Aug 3, 2018 · 9 comments
Closed
3 tasks done

App crashes when load many images from firestore - swift #2418

SamboVisal opened this issue Aug 3, 2018 · 9 comments
Labels

Comments

@SamboVisal
Copy link

SamboVisal commented Aug 3, 2018

New Issue Checklist

Info Value
Platform Name ios
Platform Version 10.13.0 / 11.0
SDWebImage Version 4.2.0
Integration Method cocoapods
Xcode Version Xcode 9
Repro rate all the time (100%)
Repro with our demo prj It happens with my demo project

Issue

I was trying to load imageUrl from firestore and load it to my application. Initially i tried to load around 4 or 10 images and it works fine. But when i want to load around 20 images and my app crashes and it also shows error in my console states that Message from debugger: Terminated due to memory issue .

@bpoplauschi
Copy link
Member

bpoplauschi commented Aug 4, 2018

@SamboVisal thanks for taking the time do describe the issue. We had similar issues in the past, usually because the iOS system cannot handle decompressing of many images at once, due to the memory spike that causes an out-of-memory crash. You can look at similar issues here: https://github.com/rs/SDWebImage/search?q=Terminated+due+to+memory+issue&type=Issues

One thing you can try is disabling the decompression:

[[SDImageCache sharedImageCache] setShouldDecompressImages:NO];
[[SDWebImageDownloader sharedDownloader] setShouldDecompressImages:NO];

Also check out these points about reducing the memory footprint: #2252 (comment)

One thing I recommend is just running the app through instruments and inspecting the memory.

@dreampiggy dreampiggy added the OOM label Aug 6, 2018
@SamboVisal
Copy link
Author

Thank for your reply. I will try to fix this. But i have another question, when images are loading and i have seen some images are in not correct order and some images are duplicate in different cells. But after, images are loaded successfully then all images are in correct order. I wonder why?

@bpoplauschi
Copy link
Member

@SamboVisal regarding the other issue, it would have been ideal to have a separate issue. But I can respond here: we also had similar issues: https://github.com/rs/SDWebImage/search?q=wrong+image&unscoped_q=wrong+image&type=Issues
I suggest you take a try with this suggestion: #968 (comment)

@ghost

This comment has been minimized.

@dreampiggy

This comment has been minimized.

@ghost

This comment has been minimized.

@bpoplauschi

This comment has been minimized.

@bpoplauschi

This comment has been minimized.

@bpoplauschi
Copy link
Member

@SamboVisal can we close this issue now? Did you get what you needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants