question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory Leak on iOS: FastImage not released from memory when callbacks onLoad is set

See original GitHub issue

An 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.

https://github.com/DylanVann/react-native-fast-image/blob/141a4a02931ba9e02ee169ba4543e77d924b6a79/ios/FastImage/FFFastImageView.m#L167

I can submit a Pull Request to transform this strong reference into a weak reference, which should fix the memory leak.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
StevenMasinicommented, Mar 23, 2019

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 ?

1reaction
StevenMasinicommented, Mar 20, 2019
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found