Application crashes on iOS 12 when device memory is low #24289
Labels
Bug
Platform: iOS
iOS applications.
Ran Commands
One of our bots successfully processed a command.
Resolution: Locked
This issue was locked by the bot.
🐛 Bug Report
I can see the following error message in bugsnag along with the crash:
C++ exception in 'nativeFlushQueueImmediate' Exception creating JSON string: Out of memory (:18)
I suspect this is something new and related to iOS 12.2 only as I've never seen such error earlier.
Affected device so far is an iPhone X. Weirdly it's free memory is just 68 MB according to bugsnag which seems quite low for me.
To Reproduce
The app is using the https://github.com/terrillo/rn-apple-healthkit library which is reading health kit data and sending large JSONs through the bridge. I suspect this crash is happening somewhere in the bridge. I'm querying for healthkit data in 24 hr batches exactly for the reason to decrease memory usage.
Expected Behavior
Application shouldn't crash even in low memory environments
Code Example
Environment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
Memory: 120.59 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 19, 22, 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.2, 23.0.3, 24.0.2, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.2, 28.0.3
System Images: android-19 | Google APIs ARM EABI v7a, android-22 | Intel x86 Atom_64, android-25 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom, android-25 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.3.2 => 16.3.2
react-native: 0.56.0 => 0.56.0
The text was updated successfully, but these errors were encountered: