question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android - App crash with OutOfMemoryError when New Architecture is enabled

See original GitHub issue

Description

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

  1. 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:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lindboecommented, Apr 14, 2022

Ah, I had Zulu 18 installed. Downgrading to Zulu 11 works.

1reaction
usmankhan495commented, Apr 14, 2022

Yes, Now it is working for both emulator and device.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
How Does OutOfMemory Error Happen and How to Solve it in ...
Memory leaks cause the OutOfMemoryError in Android. ... class non-static, the outer class will be active till the application is active.
Read more >
Out of memory error: Java heap memory on Android Studio
APK packaging would fail saying Java heap space when building from Android Studio and trying to ... 1st step: In your App, go...
Read more >
Troubleshooting build errors and crashes - Expo Documentation
If you are working on a managed app and the build error is a native error rather than a JavaScript error, this is...
Read more >
Firebase Crashlytics | A powerful Android and iOS crash ...
Spend less time triaging and troubleshooting crashes and more time building app features that delight users. Illustration of developer finding bugs. Never miss...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found