r/reactnative • u/MaybePoem • 2h ago
Help Developing on Mac, running android simulator is maxing my RAM
Hi,
I am developing a react native expo app on Macbook Air M4 with 16GB of RAM.
And whenever I am running an android simulator, either for actual build or for simulator its maxing my RAM, especially during the startup. After that it's sitting quite ok at about 5GB of RAM (which is still A LOT). But during the startup it can reach to 16GB of RAM.
I am using Android Studio built in Pixel 10 emulator.
Is there any alternative or something I am doing wrong here?
2
Upvotes
2
u/XyrelTzy 2h ago
use pixel 6 or 7. In app development android emulator, jvm, java is the one consume more ram.
1
u/rsajdok 1h ago
Use for tests android phone
1
u/MobileXapps 1h ago
Close Android Studio while the emulator runs and start it from the terminal with
emulator -avd <name>. The IDE itself takes a few GB on top of Gradle and the emulator.In the AVD settings you can also lower the RAM and pick an older Pixel image without Play Store. And if you have any Android phone lying around, plug it in over USB, it costs your Mac basically nothing.
1
u/codariadev 1h ago
That startup spike is usually two things at once: the emulator cold booting and the first Gradle build. A few things that helped me on a 16 GB machine:
emulator -list-avdsand thenemulator -avd <name>(it's in~/Library/Android/sdk/emulator).android/gradle.properties(org.gradle.jvmargs=-Xmx2048m ...) if you're doing local builds, and avoid rebuilding when you don't need to. With a dev build installed,npx expo startonly runs Metro, the native build isn't repeated.If it's still painful, a cheap physical Android phone over USB is honestly the lightest option, zero emulator overhead.
1
u/dawedev 43m ago
If the 16GB spike is at startup, check that Quick Boot is on in the AVD settings so it resumes from a snapshot instead of cold booting every time. It also helps to let the emulator finish booting before you kick off the first Gradle build, otherwise both peak at the same moment.