21

I just updated to Android SDK Tools r20, and try to create avd base on android 4.1 and WXGA, but I got error message when I start AVD.

config.ini:

hw.mainKeys=no
hw.lcd.density=320
sdcard.size=512M
skin.name=WXGA720
skin.path=platforms\android-16\skins\WXGA720
hw.cpu.arch=arm
hw.keyboard.lid=no
abi.type=armeabi-v7a
hw.cpu.model=cortex-a8
vm.heapSize=48
hw.ramSize=1024
image.sysdir.1=system-images\android-16\armeabi-v7a\

error message:

Starting emulator for AVD 'android4.1'
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.

Error was only output when i chose WXGA skin, whichever 720 or 800 I saw Failed to allocate memory: 8 page to find solution and tried to change ram size, but didn't solve my problem.

My system environment:

OS: windows 7 64bit
memory: 4GB 

I tried to start android 4.0.3 WXGA in windows 7, got same error. But same machine in Ubuntu 64bit android SDK tools r18, create android 4.0.3 WXGA, start normal.

So, what can I do for this problem?

Community
  • 1
  • 1
Gino
  • 674
  • 3
  • 8
  • 20
  • Does this helps you here? [android-emulator-failed-to-allocate-memory-8](http://stackoverflow.com/questions/11667907/android-emulator-failed-to-allocate-memory-8/11868277#11868277) – Lin-Art Aug 09 '12 at 03:59

5 Answers5

16

This seems to be a problem with SDK Tools r20, in which the amount of RAM can not be set from the AVD Manager for the WXGAxxx skins (and the default 1024 MB is too much for the 32 bit emulator).

Workaround

You can work around the issue by starting the AVD from the command line, and hard set the amount of memory to something lower:

> cd c:\program (x86)\android\android-sdk\tools\
> emulator @android4.1 -memory 896

The above command line will set the amount of memory to 896 MB for the AVD. This bug can be followed here: http://code.google.com/p/android/issues/detail?id=36080

Kodsnutten
  • 240
  • 1
  • 5
  • I ran my avd with -memory 896, it works but the avd is running as Phone mode not Table. Why? Thank you! – Gino Sep 08 '12 at 15:08
  • I let my laptop connect to other monitor which resolution is 1400X900 via VGA port, and run avd with memory 896, it's perfect solve this problem. AVD is running in Table mode with WXVGA800. Thank you! Joakim Arborelius & @Sheharyar Naseer, you give the ideas to help me to solve this problem. – Gino Sep 10 '12 at 15:35
4

Modify config.ini file like that:

hw.ramSize=1024 --> hw.ramSize=1024M

and it should work like charm...

Ref: http://www.fantageek.com/102/strange-avd-with-hw-ramsize/

khigianguyen
  • 139
  • 2
  • 8
  • I've noticed that hw.ramSize is wrong in hardware-qemu.ini file also (it stayed =256 even after I updated RAM size in "Android Virtual Device Manager") – yvolk Dec 05 '13 at 12:01
1

Are you running the emulator on your Laptop?

This problem also occurs if the Emulator's Screen Resolution is greater than that of your Display. For example WXGA-xxx (1280x800) could crash if your screen resolution is (1366x768).

Try using WSVGA. Does a good job as a Tablet.

Sheharyar
  • 73,588
  • 21
  • 168
  • 215
  • Yes, you're right! My Laptop screen resolution is 1366X768, I think this is the reason of crash. I'll try later as you told. Thank you! – Gino Sep 08 '12 at 14:45
  • I just tried, let my laptop connect to other monitor which resolution is 1400X900 via VGA port, and run avd using WXGA, get same error. I think I can't fix this problem in this way. – Gino Sep 09 '12 at 02:27
  • Does the emulator work with WSVGA? If no, then there must be something else. :/ – Sheharyar Sep 09 '12 at 23:16
-1

Degrading SDK Tools from r20 to r18 will solve the problem. You need to do this by Uninstall ing r20 and reinstalling installer_r18-windows.ex.

George Stocker
  • 57,289
  • 29
  • 176
  • 237
  • Is this a known issue? Does downgrading to an earlier SDK release (whilst it may fix the reported issue) reduce the level of support/features? – Ray Hayes Jul 30 '12 at 08:29
-3

try to update the ADT&SDK .

if that doesn't help , try to do total uninstallation of the ADT&SDK of android . even delete the ".android" folder , and in the end install them again.

android developer
  • 114,585
  • 152
  • 739
  • 1,270