App crash only on device debug build connected to Metro

Hi,

I’ve suddenly started encountering app crashes on startup when running under the following conditions:

  • On-device
  • Debug build
  • Connected to Metro service via port forwarding

All other conditions do not result in a crash (i.e. simulator, Release builds, Debug builds with no Metro connection).

I can attach an ACR but the CrashReason is always LowMemoryKiller.

I’m presuming there is additional memory overhead when running the JS bundles from Metro, but how should I approach this issue as a developer?

One debugging action I tried was switching images to use Image from react-native instead of Image from react-native-fast-image, and that did NOT crash. So, while I’m not sure that’s the actual issue, it does seem like the internal caching of images does lead to crossing the memory pressure threshold. I don’t really see a way to control the operation of the cache.

Any suggestions on how to approach this issue is appreciated!

10441#crash_1758133385_6668_lrk_com.disney.streaming.espn.main.acr (7.7 KB)

Hi @cameron_disney,

Thank you for reporting this issue. We are checking with our internal teams on this issue. We will let you know if any additional information required.

Regards,
Siva

1 Like

Hi, checking in on this issue as there hasn’t been any response in some time.

Hi @Siva_Prakash we are also encountering this crash after upgrading to latest SDK 0.21.4726.

Hi @cameron_disney & @Chandraprakash_Sutha,

We will check with the concerned team and let you know the update.

@Chandraprakash_Sutha would you be able to share Steps to reproduce this issue and crash logs for your app?

Regards,
Siva

@Siva_Prakash, the crash only happens on debug build if used for long duration. I am sharing the logs in DM.

Hi @Siva_Prakash
Any updates on this ?
Its happening every time i start the playback on debug build, it has become very difficult to debug any playback related issues.
it also happens sometimes when metro is connected while running release build.

Hi @Chandraprakash_Sutha,

Team was unable to reproduce this issue. Could you please investigate further with help from below links and share your observations?

  1. Monitor and Record Memory | Design and Develop Vega Apps
  2. Investigate JavaScript Memory | Design and Develop Vega Apps

Regards,
Siva

Hi @Chandraprakash_Sutha,

The following workarounds/mitigations were shared by the team from past occurrences of such issues. However, they helped on a case-by-case basis, and your case could possibly be different. You may need to check with your Amazon contact for a troubleshooting session if your problem persists even after optimizations.

  1. Avoid using react-native-fast-image to cache a huge number of images.
  2. Reduce the number of tiles/rows loaded at a given time.
  3. Avoid loading a huge number of full-scale images at a given time.

Regards,
Siva

Hi @Siva_Prakash

Thank you for the workarounds, I will try and let you know if i need any further assistance.

Also, its would be nice if there was a proper solution as most OTT apps has huge data to render on each page (take home screen for example) and each data has an image which is rendered using react-native-fast-image which we can not avoid..

Hi @Chandraprakash_Sutha,

Thank you. I have shared the feedback with the team for future improvements.

Regards,
Siva

1 Like