Android emulator failed to allocate memory 8

AndroidAndroid Emulator

Android Problem Overview


When I try to run my WXGA800 emulator from Eclipse it's giving an error like this

Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I checked the following links also

https://stackoverflow.com/questions/7222906/failed-to-allocate-memory-8

https://stackoverflow.com/questions/5969067

I have tried reducing RAM size in emulator and increasing Java heapsize and ramsize but still I am facing the same error.

Android Solutions


Solution 1 - Android

Update: Starting with Android SDK Manager version 21, the solution is to edit C:\Users\<user>\.android\avd\<avd-profile-name>.avd\config.ini and change the value

hw.ramSize=1024 

to

hw.ramSize=1024MB

Android 4.2 API 17

The emulator is really slow, hope they will release the intel images soon use the new API17 Intel x86 images if you want to change it .. (HAXM, Configuration)


Earlier Android SDK Manager releases:

Had the same problem with the built-in WXGA800 skin. I got it working by editing the virtual device setup to:

  • Target 4.0.3 API 15 / 4.1.0 API 16
  • SD-card 300MiB
  • Resolution 1280 x 800 (set manually -not the built-in ones)
  • Device ram size 1024MB (with MB added to the number)
  • Abstracted LCD 160

Here my tablet config for 4.1.0 API 16 C:\Users\<user>\.android\avd\<avd-profile-name>.avd\config.ini

hw.lcd.density=160
sdcard.size=300M
skin.path=1280x800
skin.name=1280x800
hw.cpu.arch=arm
abi.type=armeabi-v7a
hw.cpu.model=cortex-a8
vm.heapSize=48
hw.ramSize=1024MB
image.sysdir.1=system-images\android-16\armeabi-v7a\

This config shows the software keys too Screenshot Android 4.1 emulator 1280x800@160

Solution 2 - Android

This following solution worked for me. In the following configuration file:

C:\Users\<user>\.android\avd\<avd-profile-name>.avd\config.ini

Replace

hw.ramSize=1024

by

hw.ramSize=1024MB

Solution 3 - Android

In my case, the solution was to change not only config.ini but also hardware.ini for the specific skin from hw.ramSize=1024 to hw.ramSize=1024MB.

To find the hardware.ini file:

  1. Open the config.ini and locate skin.path.
  2. Then navigate to the folder where the android sdk is located.
  3. Open the path, like this: android-sdk\platforms\android-15\skins\WXGA720.
  4. Inside this folder you will locate the hardware.ini.
  5. Change hw.ramSize=1024 to hw.ramSize=1024MB.

Solution 4 - Android

Update: Starting with Android SDK Manager version 21, the solution is to edit C:\Users<user>.android\avd<avd-profile-name>.avd\config.ini and change the value

hw.ramSize=1024 to

hw.ramSize=1024MB

OR

hw.ramSize=512MB

Solution 5 - Android

This error fires if you set the AVD RAM to anything that is larger then the single largest block of continuous memory the emulator is able to allocate. Close anything RAM heavy, start your emulator, start everything else you need. In a previous answer I have limited this to x86 images with IntelHAXM, but this actually is the case for all types of emulator instances.

Solution 6 - Android

In the AVD setup: Change the CPU/ABI option to MIPS. It worked for me

Solution 7 - Android

I had the same problem and what ended up being the issue was the RAM size: apparently 1024 (or whatever size) is different from 1024MB. Make sure you specify the units and it should work for you.

Solution 8 - Android

Changing the ramSize in config.ini file didnt work for me.

I changed the SD Card size to 1000 MiB in Edit Android Virtual Device window ...It worked! :)

Solution 9 - Android

Go to edit Android Virtual Devices and change the 1024 Under Memory Options to 768. If it still doesn't work, keep going lower and lower.

Solution 10 - Android

Reducing the RAM size in the AVD settings worked for me. The AVD being slow can eat up a lot of RAM, so keeping it at a minimum is feasible.

Solution 11 - Android

For Skin remove No Skin and add some skin into it

enter image description here

Solution 12 - Android

Try this if other answers did not work for you.

For me This happened for API 27 Emulator.

API 26 Emulator worked just fine. So I started API 26 Emulator first and then closed it.

Then I started API 27 Emulator and It worked with No errors at all.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVishwanath.MView Question on Stackoverflow
Solution 1 - AndroidLin-ArtView Answer on Stackoverflow
Solution 2 - AndroidboingView Answer on Stackoverflow
Solution 3 - AndroidMarlosView Answer on Stackoverflow
Solution 4 - AndroidAlexander ZaldostanovView Answer on Stackoverflow
Solution 5 - AndroidptashekView Answer on Stackoverflow
Solution 6 - Androidback2backView Answer on Stackoverflow
Solution 7 - AndroidPaulView Answer on Stackoverflow
Solution 8 - AndroidNamrataView Answer on Stackoverflow
Solution 9 - AndroidFranzPhillipsView Answer on Stackoverflow
Solution 10 - AndroidSylarView Answer on Stackoverflow
Solution 11 - AndroidJimit PatelView Answer on Stackoverflow
Solution 12 - AndroidAkshar PatelView Answer on Stackoverflow