Home » Android » android – Failed to allocate memory: 8

android – Failed to allocate memory: 8

Posted by: admin March 10, 2020 Leave a comment

Questions:

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.

How to&Answers:

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.

Answer:

Referring to Android: failed to allocate memory and its first comment under accepted answer, changing “1024” to “1024MB” helped me. Pathetic, but works.

Answer:

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~

Answer:

Works with 512 Mb instead. None of the above methods works for me.

Answer:

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.

Answer:

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.

Answer:

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.

Answer:

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

or

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

Answer:

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…

Answer:

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.

Answer:

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.

Answer:

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.

Answer:

I solved by put as storage size 2 times the RAM size, and by putting the SD storage size the same as RAM size.

Answer:

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.

Using Windows 64bit, Xoom (Android 3.0).

Answer:

In my case, changin screen resolution from WVGA720 to WSVGA works for me.

Answer:

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.

Answer:

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
5) Win

Answer:

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:

android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager

Also, be sure that Intel Virtual Technology is enabled in your BIOS.

Follow the guide on developer.android.com or Intel’s installation instructions.

Answer:

You only need to edit your virtual device’s ram, making it lower! Try 20 MB, and it will work!

Answer:

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.