The app uses RNFetchBlob to retrieve an image from the server. This is retrieved and stored locally on click. Once the image loads to the view - using the <Image/> component supplied by react-native - I can see in the XCode profiler that the memory usage increases, as expected.
Then, the user can navigate back, which is done with navigation.goBack() from the react-navigation package. What I would then expect to see is the memory used for that screen to be freed entirely. Whereas, what actually happens, is that the memory is taken up and never freed. The GIF below should explain what I mean:
I don't understand how to free this memory, be it manual or automated.
I've tried:
- react-native-fast-image
- unlinking the file with RNFetchBlob.unlink
- resetting the navigation state
- Adding a condition on isFocused which returns empty if out of focus
- Only viewing the file remotely
Any advice would be greatly appreciated!
