Android - App crash with OutOfMemoryError when New Architecture is enabled
See original GitHub issueDescription
Tested app with new architecture enable on physical device and emulator. It is crashing on both with different logs. Physical device logs : A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x6f53b77000 in tid 26254 (mqt_js), pid 21727
Emulator logs: java.lang.OutOfMemoryError: Failed to allocate a 321682744 byte allocation with 4077047 free bytes and 188MB until OOM, target footprint 8186863, growth limit 201326592
NDK version : 24.0.8215888
- Still crashing after updating memory size.
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Version
0.68.0
Output of npx react-native info
System: OS: macOS 11.6 CPU: (8) arm64 Apple M1 Memory: 147.16 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.8.0 - /opt/homebrew/bin/node Yarn: 1.22.18 - /opt/homebrew/bin/yarn npm: 8.5.5 - /opt/homebrew/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8309675 Xcode: 13.0/13A233 - /usr/bin/xcodebuild Languages: Java: javac 18 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.0 => 0.68.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Just created a new app using npx react-native init.
Repo Link : https://github.com/usmankhan495/TestProject
Snack, code example, screenshot, or link to a repository
https://github.com/usmankhan495/TestProject No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Ah, I had Zulu 18 installed. Downgrading to Zulu 11 works.
Yes, Now it is working for both emulator and device.