Search code examples
androidandroid-studioandroid-emulatorcicdqemu

How to allocate more than 4GB for android emulators?


I have an Android emulator setup in my CI server. I notice that when I boot it up with more than 4GB of RAM eg.

emulator -avd myEmulator -m 6144

, a warning message appears:

pc_memory_init: above 4g size: 4000000

When I check my RAM size using adb, it is fell back to 4GB.

How to allocate more than 4GB for the emulator ?


Solution

  • It turns out that using this command line after emulator is booted:

    adb shell “cat /proc/meminfo”
    

    I'm able to see that the RAM size allocated for emulator is exactly what I put in the command line:

    emulator -avd myEmulator -m ${RAM_SIZE}