Failed to allocate memory: 8 with WXGA720 skin

2019-08-14 08:23发布

问题:

I see a lot of questions about Failed to allocate memory: 8 The general recommendation is to decrease memory from 1024 to 512MB

Other posts Failed to allocate memory: 8 Android - Failed to allocate memory

On my old computer everything worked fine, after I upgraded to a new machine with 8GB of memory and Windows 7 64bit I am getting the problem.

The problem only appears on Emulators with a Large "Skin" (screen resolution). I want to run my application on a WXGA720 or larger screen, but startup failes with "Failed to allocate memory: 8", decreasing memory does not help.

回答1:

I am having the same problem. It appears to be an issue with the emulator. The solution they say is to downgrade to tools r19. There are zip on this site you can download. You just unzip and replace the tools folder in you sdk with the tools folder in the zip file. I just tried it and I got an error message saying I have tools r19 and I need tools r20 but I just closed the message and it seems to be working so far.

http://code.google.com/p/android/issues/detail?id=33930



回答2:

A possible workaround is to edit the file "hardware.ini" located in the directory of the skin you want to use.( e.g. C:\Android\android-sdk\platforms\android-15\skins\WXGA720). In that file I set hw.ramSize to 720 in place of 1024 and now I can finally start my virtual device from AVD Manager.



回答3:

That did help in my attempts to emulate a Nexus 7. I changed it to 512. If its useful to anyone, I did not change the Target to "Google API" (as suggested in other posts) but rather kept it to "Android 4.1.2" (what's the difference again?)



回答4:

As I mention here: https://stackoverflow.com/a/14420779/1993898

I was able to fix this error by running AVD "as Administrator", with no changes required to my emulator setup. Therefore, I believe this error to be related to filesystem permissions, or lack thereof.