Android 4.0.3 模拟器崩溃:无法分配内存:8

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11318348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 06:55:16  来源:igfitidea点击:

Android 4.0.3 emulator crashes: Failed to allocate memory: 8

androidandroid-emulator

提问by Eli Revah

The problem started when I changed the skin built-in display setting to WXGA720. Then everytime I'm trying to run the emulator it says the following message:

当我将皮肤内置显示设置更改为 WXGA720 时,问题就开始了。然后每次我尝试运行模拟器时,它都会显示以下消息:

Starting emulator for AVD 'android403' 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.

为 AVD 'android403' 启动模拟器无法分配内存:8 此应用程序已请求运行时以异常方式终止它。请联系应用程序的支持团队了解更多信息。

I already tried to lower down the RAM size to 800 MB and then 512 MB (or even 256) but it didn't work either...

我已经尝试将 RAM 大小降低到 800 MB,然后降低到 512 MB(甚至 256),但它也不起作用......

I don't know what to do...

我不知道该怎么办...

Here's a screenshot of the emulator settings window:

这是模拟器设置窗口的屏幕截图:

enter image description here

在此处输入图片说明

Thanx upfront.

谢谢提前。

回答by arpy

I do sometimes have the same problem. Maybe my solution works for you as well: Instead of choosing the WXGA720 skin preset, manually set the resolution to 720*1280, and manually set the RAM to 768 or even 512. Seems stupid, but it makes a difference if the skin preset is uses or a manual resolution configuration.

我有时也会遇到同样的问题。也许我的解决方案也适用于您:不要选择 WXGA720 皮肤预设,而是手动将分辨率设置为 720*1280,并将 RAM 手动设置为 768 甚至 512。看起来很愚蠢,但是如果皮肤预设是使用或手动分辨率配置。

回答by Shiva Ram

I had the same problem. I have set the resolution manually to 720 X 1280. Set the RAM size as 128MBand SSD to 16 MB. The app came up without any problems after that

我有同样的问题。我已手动将分辨率设置为720 X 1280. 将 RAM 大小设置为128MB并将 SSD 设置为16 MB。该应用程序在此之后没有任何问题

回答by cgWhitney

This may sound silly, but I resolved the issue by adding "MB" after the RAM setting, changing (for example) 1024 to 1024MB.

这听起来可能很傻,但我通过在 RAM 设置后添加“MB”解决了这个问题,将(例如)1024 更改为 1024MB。

回答by Saqib Hayat

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. enjoy ;)

我想到了。问题出在我为虚拟机指定的内存量上,它是 1024MB,现在我有 512MB 并且没问题。请享用 ;)

回答by manjusg

I also faced the same problem for x86 emulator for android 4.0.3. This problems happens to me only when i try to launch emulator from eclipse. But works fine when i launched the emulator from command line. Try to launch the emulator from command line.

对于 android 4.0.3 的 x86 模拟器,我也遇到了同样的问题。只有当我尝试从 Eclipse 启动模拟器时才会出现这个问题。但是当我从命令行启动模拟器时工作正常。尝试从命令行启动模拟器。

Go to android tool directory and use "emulator -avd " to launch your emulator.

转到 android 工具目录并使用“emulator -avd”启动您的模拟器。

回答by Jordan

I had the same problem, trying to emulate the Galaxy S3. Setting the resolution to 720 x 1280 and dropping ram from 1024 to 700 worked for me. Could't get it to work at all on the built in wxga720 settings.

我遇到了同样的问题,试图模拟 Galaxy S3。将分辨率设置为 720 x 1280 并将内存从 1024 降到 700 对我有用。在内置的 wxga720 设置上根本无法使用它。

回答by user1373225

I was with the same problem today, but I manage how to solve it ( at least for me, because I was doing it in the wrong way), hope that it can be usefull for you too.

我今天遇到了同样的问题,但我设法解决了它(至少对我来说,因为我以错误的方式做它),希望它对你也有用。

I was trying to change de Device RAM memory direct by Eclipse via Android Virtual Device Manager. I don't know why, but this changes does not affect the "hardware.ini" file that is present in : \android-sdk\platforms\android-16\skins\WXGA800-7in , for example. To change the device RAM, or just to add MB you need to change this file.

我试图通过 Android 虚拟设备管理器直接由 Eclipse 更改设备 RAM 内存。我不知道为什么,但是这种更改不会影响存在于以下位置的“hardware.ini”文件:\android-sdk\platforms\android-16\skins\WXGA800-7in 例如。要更改设备 RAM,或者只是添加 MB,您需要更改此文件。