nhaarman
nhaarman

Reputation: 100468

Android Emulator: Failed to allocate memory: 8 even with 8MB RAM

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 from 1024 to 512, but when I even set it to 8 it still crashes with this error!

What should I do?

Screenshot of the settings:

enter image description here

Here the error message Windows gives of the crashed emulator-arm.exe:

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: emulator-arm.exe
  Application Version:  0.0.0.0
  Application Timestamp:    4fe779fb
  Fault Module Name:    emulator-arm.exe
  Fault Module Version: 0.0.0.0
  Fault Module Timestamp:   4fe779fb
  Exception Code:   40000015
  Exception Offset: 0014428e
  OS Version:   6.1.7600.2.0.0.768.3
  Locale ID:    1043
  Additional Information 1: ea2b
  Additional Information 2: ea2b4716fbf9f89aacc15214fb1537bb
  Additional Information 3: 8d2f
  Additional Information 4: 8d2f162ccf8522e475fc4fbe036a6efa

The last time I checked and the emulator worked was before updating to ADT 20 and before deleting all old AVD's.

Upvotes: 6

Views: 23631

Answers (5)

T.Todua
T.Todua

Reputation: 56555

Solved problem with:

Open config.ini (location: C:\USERS\ YOURUSERNAME\.android\avd ) and set i.e.

hw.ramSize=512

to

hw.ramSize=512mb

Upvotes: 0

Furqan
Furqan

Reputation: 465

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.

Upvotes: 4

Prymaldark
Prymaldark

Reputation: 141

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.

Upvotes: 0

Frank
Frank

Reputation: 625

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).

Upvotes: 1

EGHDK
EGHDK

Reputation: 18130

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.

Upvotes: 8

Related Questions