react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

ios memory issue

Open wowjdd133 opened this issue 4 years ago • 6 comments

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

  • React Native version: 0.60.6
  • React version: 16.8.6
  • React Native Fast Image version: 8.3.2 or 8.1.2

wowjdd133 avatar Oct 21 '20 05:10 wowjdd133

any news?

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

ahtokca avatar Jan 21 '21 18:01 ahtokca

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.

dandre-hound avatar Jan 26 '21 22:01 dandre-hound

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

jcharbo avatar Feb 01 '21 19:02 jcharbo

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

dandre-hound avatar Feb 01 '21 19:02 dandre-hound

hi @wowjdd133 ,

Any solution for this?

Thanks

akhilsanker avatar Mar 08 '22 05:03 akhilsanker

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.

alexkendall avatar Sep 02 '22 18:09 alexkendall