Memory Leak on iOS: FastImage not released from memory when callbacks onLoad is set
See original GitHub issueAn engineer at my company noticed a memory leak on iOS when the props onLoad
is set on iOS.
FastImage doesn’t get released when it should be.
After investigating the source code, I found out that using a strong
reference to self
to call sendOnLoad
in sd_setImageWithURL
.
I suspect this line to be the cause of this memory leaks.
I can submit a Pull Request to transform this strong
reference into a weak
reference, which should fix the memory leak.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:17 (8 by maintainers)
Top Results From Across the Web
A memory leak when capturing callb… - Apple Developer
A memory leak when capturing callback function from block of setTerminationHandler of NSTask.
Read more >react-native-fast-image | Yarn - Package Manager
Low performance in general. FastImage is an Image replacement that solves these issues. FastImage is a wrapper around SDWebImage (iOS) and Glide (Android)....
Read more >Memory leak when loading images - Stack Overflow
This code, which is based on this answer, solved it for me var fileQueue = []; var lock = false; var img =...
Read more >How to improve the performance of a React Native app
Learn from this article how to improve the performance of a React Native app. Good performance is crucial for any app or product....
Read more >Nitish Sharma, Author at LogRocket Blog
Atoms: These are the building blocks, which cannot be further ... .release() is used to release the memory reserved to play the audio...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would be happy if people could try my PR #433. It should fix the memory leak on iOS.
Let me know if it works for you or not ?
I made a new Pull Request here https://github.com/DylanVann/react-native-fast-image/pull/433