My expo app is crashing in prod, how do I troubleshoot it?

@dmitryame

The above stuff from your log is about RAM (actually VM/Virtual Memory, but that is basically RAM and definitely not storage space)

The log indicates that the device has run out of RAM and as a result the OS starts killing processes.
Unfortunately, the log doesn’t (and probably can’t) tell you what is causing the high RAM usage.

That is especially strange, because I typically do not run too many applications at the same time. As a matter of fact my app will crash even if it’s the only app that is running and nothing is in background mode.

Sure. I am not suggesting that other apps are to blame.

I was not suggesting that the other apps are to blame either. I was trying to say, that I can hardly believe that my app (while it’s the only app running on the device) will start causing the device to run out of memory, and it will start happening gradually (like it will accumulate some state which will survive app or even the device reboots). All this is very strange and I can not find any meaningful explanation so far.

i finally figured out the cause of this crash. It took me a while. It’s been going on since Jan. So, in iOS when you are rendering a full size image it will take a lot of memory, regardless of the size of the image on the screen. I was caching the full size version in place of thumbnail, because thumbnail is not available until it makes a trip to the server-side (the thumbs are generated on the server after the image is uploaded). As the result, the photos that I took would render the full version in the list view where the thumbnails supposed to render. I was able to reproduce it very consistently — when I take more than 15 photos — the app will start to crash. The temporary solution was to clear the cache by delivering over the air update, or re-install the app (which would also clear the cache). It would only happen for most active users like me, who are taking a lot of photos. Now I resize the images locally and always render the thumb of the smaller version of the image. So far was not able to reproduce the crash regardless of how many photos I take with the app. Will be doing some more testing and then will be releasing a new version to the app store.
Perhaps my assumptions about how FileSystem.cacheDirectory works are also not correct – will be doing some more testing to see if it does clear the cached files automagically, stay tuned.

Thank you all who was putting up with me and listening to my mumbling :slight_smile:rubber duck debugging works

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.