How can I change the ram amount that the android emulator is using?
or you can create a new hardware profile, that allows you to choose the amount of ram avaliable. Also you can change the number of CPU cores in the hardware-quemu.ini and config.ini on the device files.
My answer seems to be old, so for recent versions check this answer
Go to Tools->Android->AVD Manager
, there's something like pencil to edit your AVD
click on that, then in the pop-up window click Show Advanced Settings
and there you can change the RAM
size.
Create a new virtual device from the AVD Manager.
Select New hardware profile(left-bottom corner) in the appearing window.
You can see an option Memory in the new secondly appeared window. Here you can change the ram size in the column RAM.
I generated a Pixel 2 image in the past and those values were locked to match the HW default of 1536
MB, so to edit them I had to "Show on disk" (from ADV manager) and edit the hw.ramSize
keys in hardware-qemu.ini
and config.ini