Android: failed to allocate memory

Solution to running a faster emulator:

http://androiddevnotes.com/2011/03/08/1299521520000.html

Runs my game a lot faster, comparable to phone quality.

-- Update 08/24/12 --

I see that people still come here and comment on this answer, and I have done more research on this issue. I present to you the results of my findings.

NOTE: These tests were run on my computer, your computer may be different.

  1. Running an Android 2.2 (armeabi) emulator with Property 'Device ram size' = 2048 will fail, just as before
  2. Running an Android 2.2 (armeabi) emulator with Property 'Device ram size' = 2048 MB will pass, however if you actually check the ram on the device, its around 128 MB.
    • check 1: Settings > Applications > Running Services - add all the numbers on the bottom of the screen
    • check 2: run the following command in adb shell: cat /proc/meminfo/ and note the MemTotal field
  3. Running an Android 4.1 (armeabi-v7) emulator with Property 'Device ram size' = 2048 will work, however if you actually check the ram on the device its around 512 MB
    • check 1: Settings > Apps > Running tab - add all the numbers on the bottom of the screen
    • check 2: run the following command in adb shell: cat /proc/meminfo/ and note the MemTotal field
  4. Running an Android 4.1 (armeabi-v7) emulator with Property 'Device ram size' = 2048 MB will work as well, but with the same results as 3.

Conclusion

Adding 'MB' as noted in some of the comments below may allow your device to be launched, however it doesn't actually have 2 GB of RAM. Even with a 4.1 Emulator, the RAM Size is at 512 MB.

Recommendation

Please use an actual device for testing.


I also get this error. Use RAM 512.


I was also getting this error message after upgrading my Android ADK Tool to 20 (even though I have more than sufficient RAM). No changes made to the 'Device RAM size' property helped (whether higher or lower, or with "MB").

What did work for me is running the emulator at the command line and specifying the RAM amount there (less than the default in my case); for example:

emulator -memory 512 -avd my_avd