From today, when I tried to run an app in NetBeans on a 2.3.3 Android platform, it shows me that:
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.
and the Emulator doesn’t want to start.
This is for the first time when I see it, and google has no asnwers for this, I tried even with 2 versions of NetBeans 6.9.1 and 7.0.1, still the same error.
I figured it out. The problem was in the amount of ram I had specified for the virtual machine, and it was 1024MB, now I have 512MB and it is ok, now I need to find how to improve this amount of ram, 512 is not so much, and the machine is a little bit laggy.
Referring to Android: failed to allocate memory and its first comment under accepted answer, changing “1024” to “1024MB” helped me. Pathetic, but works.
In my case:
- Using built in WXGA720 to simulate 720p device, always got this error
- Manually set AVD resolution to 720 x 1280, works for me
hope it helps~
Works with 512 Mb instead. None of the above methods works for me.
Everything else you read here and elsewhere is pure conjecture. The only sure-way to fix this problem is vote for this bug report.
The problem isn’t related to emulator resolution or OpenGL, nor how much memory your computer has. I’ve got 24GB memory in my computer and most of the time I run with
hw.ramSize=1024 I get error 8. Other times it works just fine without any configuration changes. I hope you caught that: I did not alter the emulator configuration at all and yet sometimes it runs and sometimes it fails.
There is a high probability it has something to do with memory fragmentation. I recommend reducing the value of
hw.ramSize as a temporary workaround.
Looks like there are a thousand different fixes for this…none of the above worked for me, but what worked was to launch the AVD from the command line emulator-arm.exe @AVD-NAME
Somehow if launched with only emulator.exe, I would get the same error message than when trying to launch via Eclipse.
I realized the solution to this problem stems from Eclipse memory allocation when you run the application in normal mode. I just checked the “Run as Administrator” box under the shortcut properties for Eclipse and now it allows me to allocate more memory for the AVD.
Hope that helps.
I have overcome this problem by changing the device screen size.
I have found that if you are specifying 1024 mb ram then you have to specify the device screen size in hdpi only and if it is 512 mb ram then it should be mdpi or others.
So, We can clearly say that ram size should be specify according to the screen size . If you are specifying the 1024 ram size while keeping the device screen size in mdpi then it results in the above mentioned error i.e “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.”
make your options in AVD manager as follows:[2013-01-11 14:44:01 – SDK Manager] hw.sensors.orientation=yes [2013-01-11 14:44:01 – SDK Manager] hw.camera.front=none [2013-01-11 14:44:01 – SDK Manager] hw.gps=yes [2013-01-11 14:44:01 – SDK Manager] skin.dynamic=no [2013-01-11 14:44:01 – SDK Manager] hw.keyboard=no [2013-01-11 14:44:01 – SDK Manager] vm.heapSize=32 [2013-01-11 14:44:01 – SDK Manager] hw.ramSize=343
I went through all the other solutions mentioned on this thread and didn’t find anything that was working so I dinked around a little. The Google version of the API was failing on me for some reason. I changed it back to the vanilla and no more crashes.
I must have some other issue but maybe this will help somebody…
Have a look at the official issue 33930. There is pointed out, that it may have to do with the start up of OpenGL during the start of the emulator. Others wrote it only crashes when they use WXGA800-skin and suggest to manually set the resolution to 800×1280.
Further there are ZIP-files provided to manually downgrade your android SDK to version 19 and plattform-tools to version 11. This may help as well to temporally fix the issue.
I have 16 GB and a 3.4 Ghz quad core proc in my machine. The virtual machine won’t let me run it at 1024 either. I did bump it up to 878MB because it failed at 880 with the same message. This seems to be the most ram I can allocate to the emulator. It is still slow but I’m assuming it is better than 512MB.
I change my monitor DPI settings from the launch options of AVD and synchronized it with the original and current setting of my monitor, and it worked.
I solved by put as storage size 2 times the RAM size, and by putting the SD storage size the same as RAM size.
I had the same issue but before I got the issue it asked me to capture a video source.
I disabled the camera support and I was able to use
1024MB of RAM.
64bit, Xoom (Android 3.0).
In my case, changin screen resolution from WVGA720 to WSVGA works for me.
The problem is in memory fragmentation. OS have to allocate all the ram you specified for vm ( say 1Gb) as one continuous block. Sometimes there is no such block. To fix it close running programs, then run avd and start your virtual machine.
What worked for me on Windows was:
1) Closing Eclipse
2) Running Avd UI
3) Closing all running processes, especially ones that are heavy in memory, like Chrome, explorer.exe, etc
4) Start the emulator
Be sure that IntelHAXM is installed correctly. It’s not enough to download and “install” it through the SDK Manager. You need to manually install it from:
Also, be sure that Intel Virtual Technology is enabled in your BIOS.
You only need to edit your virtual device’s ram, making it lower! Try 20 MB, and it will work!
I noticed it was related to just one avd all the rest of the ones I have worked fine. I deleted it and created a new one and now it works.