Description
We are seeing a production crash on Android related to memory exhaustion when using react-native-screens with Fabric (New Architecture) enabled.
The crash consistently points to:
NativeProxy.nativeAddMutationsListener during ScreensModule.setupFabric.
This appears to be a native memory issue (std::bad_alloc), potentially caused by mutation listeners or screen references accumulating over time.
Crash Stacktrace
Fatal Exception: java.lang.OutOfMemoryError
std::bad_alloc
com.swmansion.rnscreens.NativeProxy.nativeAddMutationsListener (NativeProxy.kt)
com.swmansion.rnscreens.ScreensModule.setupFabric (ScreensModule.kt:69)
com.swmansion.rnscreens.ScreensModule.onHostResume (ScreensModule.kt)
com.facebook.react.bridge.ReactContext$1.run (ReactContext.java:214)
android.os.Handler.handleCallback (Handler.java:995)
android.os.Handler.dispatchMessage (Handler.java:103)
com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage
android.os.Looper.loopOnce (Looper.java:273)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:975)
Steps to reproduce
- Enable New Architecture (Fabric) in React Native
- Use
react-native-screens with React Navigation
- Navigate repeatedly between screens (push/pop flows)
- Send app to background and resume multiple times
- After extended usage, observe memory growth
- Eventually app crashes with OutOfMemoryError
Note: No minimal reproducible example yet — issue only observed in production over time.
Snack or a link to a repository
Not available (issue occurs only in production, not reproducible in minimal setup yet)
Screens version
4.18.0
React Native version
0.82.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Release mode
Device
Real device
Device model
Samsung Galaxy Z Fold7 (Android 16) , Samsung Galaxy S26 Ultra (Android 16) , Samsung Galaxy S25 Ultra (Android 16)
Acknowledgements
Yes
Description
We are seeing a production crash on Android related to memory exhaustion when using
react-native-screenswith Fabric (New Architecture) enabled.The crash consistently points to:
NativeProxy.nativeAddMutationsListenerduringScreensModule.setupFabric.This appears to be a native memory issue (std::bad_alloc), potentially caused by mutation listeners or screen references accumulating over time.
Crash Stacktrace
Steps to reproduce
react-native-screenswith React NavigationNote: No minimal reproducible example yet — issue only observed in production over time.
Snack or a link to a repository
Not available (issue occurs only in production, not reproducible in minimal setup yet)
Screens version
4.18.0
React Native version
0.82.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Release mode
Device
Real device
Device model
Samsung Galaxy Z Fold7 (Android 16) , Samsung Galaxy S26 Ultra (Android 16) , Samsung Galaxy S25 Ultra (Android 16)
Acknowledgements
Yes