DylanVann / react-native-fast-image

🚩 FastImage, performant React Native image component.
MIT License
8.13k stars 1.49k forks source link

ios memory issue #736

Open wowjdd133 opened 3 years ago

wowjdd133 commented 3 years ago

Describe the bug

A memory issue occurs in ios while loading up to 5 feed images in swipe format and 10 feeds at a time and loading up to 50 fast images. Even if you load up to 10 feeds each, a memory issue occurs and the app crashes.

Dependency versions

ahtokca commented 3 years ago

any news?

I got the issue as well. iPhone8 with 8.3.2 Memory consumption jumps very high and ios closes the app

dandre-hound commented 3 years ago

When profiling in instruments, I can see that the regular <Image /> component from RN deallocates itself when it scrolls offscreen in a flatlist, but <FastImage /> only deallocates itself 50% of the time. Unsure if this helps, but that's where our memory leaks are coming from. Unmounting the screen entirely seems to deallocate everything, but it's specifically in virtualized lists where we see large memory spikes.

Clearing the FastImage cache on low memory warning in the meantime has significantly lowered our out of memory crashes on ios and android.

jcharbo commented 3 years ago

@dandre-hound can you please tell me how you cleared the cache on low memory? thanks

dandre-hound commented 3 years ago

Yes @jcharbo, I just forked this repo and merged in this PR: https://github.com/DylanVann/react-native-fast-image/pull/425

akhilsanker commented 2 years ago

hi @wowjdd133 ,

Any solution for this?

Thanks

alexkendall commented 1 year ago

When profiling in instruments, I can see that the regular <Image /> component from RN deallocates itself when it scrolls offscreen in a flatlist, but <FastImage /> only deallocates itself 50% of the time. Unsure if this helps, but that's where our memory leaks are coming from. Unmounting the screen entirely seems to deallocate everything, but it's specifically in virtualized lists where we see large memory spikes.

Clearing the FastImage cache on low memory warning in the meantime has significantly lowered our out of memory crashes on ios and android.

Super helpful. Thanks for that information. Trying something similarly now.