Reputation: 3106
I'm trying to create an emulator with 2047 mb ram. When I run it, I get this error:
[2011-02-22 14:24:14 - Emulator]
[2011-02-22 14:24:14 - Emulator] This application has requested the Runtime to terminate it in an unusual way.
[2011-02-22 14:24:14 - Emulator] Please contact the application's support team for more information.
[2011-02-22 14:24:26 - Emulator] Failed to allocate memory: 8
I understand that lowering the number will make it work. But I'd rather have it with more ram, so I can test a game I'm developing. I'm assuming with more ram, it would run faster...
Has anyone got 2047 mb of ram on the emulator? If so, how? What settings did you use? Did you change anything special on your computer?
Using windows 7 64-bit, updated to the latest android sdk. Also I have over 8gb of ram available. I do have one device (motorola milestone) to test on, however since it is a network-based game I need at least one other client (hoping to use the emulator) to run with in addition to my phone.
Upvotes: 20
Views: 72808
Reputation: 834
Below is what solved the problem for me
Credit goes to this link https://stackoverflow.com/a/17091571/10412027
Here's how to fix it and keep your desired amount of RAM:
Go into the AVD folder (example: C:\Users\username.android\avd\phone.avd) Open the "config.ini" file in Wordpad. Modify the 'partition' and 'ram' lines to end in "MB" (See below for the proper syntax changes) ORIGINAL: disk.dataPartition.size=512M
MODIFIED: disk.dataPartition.size=512MB
ORIGINAL: hw.ramSize=1024
MODIFIED: hw.ramSize=1024MB
Save the file, and then run the emulator again (e.g. "emulator.exe -avd phone"). You must repeat this process for each of your AVDs.
Upvotes: 0
Reputation: 5894
I had to do this Go to "Tools -> Android -> AVD Manager -> Chose your device -> Edit -> Advanced Settings -> Change the RAM parameter to 512 Mb.
Upvotes: 0
Reputation: 1597
I had the same problem but then figured it out. The problem was in the amount of ram I had specified for the virtual machine, and it was 1024MB by default, now I changed it to 512MB and it works; though my pc has 8GB of RAM.
Upvotes: 3
Reputation: 2537
Simple computer reboot helped me after I installed HAXM and got that error :)
Upvotes: 0
Reputation: 737
Edit the Device settings and change the RAM allocation to a lower number. If it was 1024 or More, reduce it to 512Mb or 256Mb. You can Change it in "Edit Android Virtual Device (AVD)" dialog's Hardware Section --> Device ram size
Upvotes: 2
Reputation: 141
I was getting "failed to allocate memory: 8" errors as well. I have W7-64bit and 8GB of RAM. I found that by running AVD "as Administrator" the error disappeared, allowing the emulator to launch.
Upvotes: 1
Reputation: 7394
Solution is that you go and edit the config file for that perticuler avd in .android folder in your user folder in c drive with RAM = 1024 MB instead 1024
The problem is MB is not there...
Upvotes: 5
Reputation: 1018
Add in Run Configurations window the parameter -memory 512
See screenshot for reference
Upvotes: 12
Reputation: 2613
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
Upvotes: 13
Reputation: 3106
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.
cat /proc/meminfo/
and note the MemTotal fieldcat /proc/meminfo/
and note the MemTotal fieldConclusion
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.
Upvotes: 20
Reputation: 192
I changed my monitor's DPI settings from the launch options of AVD and syncronized it with the original and current setting of my monitor, and it works for me.
Upvotes: 1
Reputation: 41
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). i hope this helps for anyone with the same problem.
Upvotes: 2