I\'m trying to start an emulator, but I keep getting the error Failed to allocate memory: 8
.
There are some solutions to this problem, setting the RAM
Open config.ini (location: C:\USERS\ YOURUSERNAME\.android\avd ) and set i.e.
hw.ramSize=512
to
hw.ramSize=512mb
Under Windows, no matter how much RAM you have in the PC, it seems setting the emulator around 900MB is about the max it can handle. 1024MB always fails for me with 6GB of RAM and Windows 7 x64.
One other key note, for the device RAM Size, always include "MB" at the end. It seems to randomly works/crashes without it, but works reliably with it. Many pre-built emulators seem to leave this off. For example, use 900MB (no space).
I've had problems like this. The only way to fix it was to set it to either 256, 512 or 1024. I have no idea why it won't work with any random value.
As I mention here: https://stackoverflow.com/a/14420779/1993898
I was able to fix this error by running AVD "as Administrator", with no changes required to my emulator setup. To ensure clarity, my emulator is setup with '1024' in the RAM field, no MB tag needed. Therefore, I believe this error to be related to filesystem permissions, or lack thereof.
You need to access avd config file that resides in:
C:\Users\Furqan\.android\avd\Gingerbread.avd
Here my user name is Furqan and Gingerbread.avd is the name of emulator device
there is config.ini
file there, you can change ramsize or vm.heapSize=128
hw.ramSize=2048mb
Makesure ramsize should be in mb and similarly you can change any thing in the emulator from here easily.
avd.ini.encoding=ISO-8859-1
hw.sdCard=no
hw.device.manufacturer=Google
hw.mainKeys=yes
hw.lcd.density=320
hw.accelerometer=yes
hw.dPad=yes
hw.cpu.arch=arm
skin.name=720x1280
abi.type=armeabi
hw.device.hash=-708107041
hw.trackBall=no
hw.device.name=Galaxy Nexus
hw.camera.back=emulated
hw.sensors.proximity=yes
hw.battery=yes
disk.dataPartition.size=200M
image.sysdir.1=platforms\android-10\images\
hw.audioInput=yes
hw.sensors.orientation=yes
hw.camera.front=emulated
hw.gps=yes
skin.dynamic=yes
skin.path=720x1280
hw.keyboard=yes
vm.heapSize=128
hw.ramSize=2048mb
Note: hw.ramSize
put mb in small case as upper case didnt work for me.