安卓:无法分配内存 [英] Android: failed to allocate memory

查看:119
本文介绍了安卓:无法分配内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个具有2047 MB​​内存仿真器。 当我运行它,我得到这个错误:

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

有没有人有2047 MB​​内存的模拟器上?如果是这样,怎么样?你用什么设置?你有没有在您的计算机上更改什么特别?

使用Windows 7 64位,更新到最新的Andr​​oid SDK。我也有超过可用RAM 8GB的。我有一个设备(摩托罗拉Milestone)来测试,但因为它是一个基于网络的游戏,我需要至少一个其他客户端(希望利用仿真器)与除了我的手机上运行。

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.

推荐答案

解决方案运行更快的仿真器:

Solution to running a faster emulator:

<一个href="http://androiddevnotes.com/2011/03/08/1299521520000.html">http://androiddevnotes.com/2011/03/08/1299521520000.html

运行我的比赛快了很多,媲美手机质量。

Runs my game a lot faster, comparable to phone quality.

- 更新12年8月24日 -

我看还是有人来到这里,并在此答案评论,我已经在这个问题上做更多的研究。我present给你我的发现结果。

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.

  1. 与物业设备的RAM大小运行在Android 2.2(armeabi)模拟器= 2048将 失败,就像以前一样
  2. 与物业设备的RAM大小运行在Android 2.2(armeabi)模拟器= 2048 MB 会通,然而如果你真正把该设备上的RAM,其约128 MB。
    • 检查1:设置>应用程序>正在运行的服务 - 在屏幕底部的
    • 添加的所有号码
    • 检查2:运行在亚行的shell下面的命令:执行cat / proc / meminfo中/ ,并记下的 MemTotal 字段
  1. Running an Android 2.2 (armeabi) emulator with Property 'Device ram size' = 2048 will fail, just as before
  2. Running an Android 2.2 (armeabi) emulator with Property 'Device ram size' = 2048 MB will pass, however if you actually check the ram on the device, its around 128 MB.
    • check 1: Settings > Applications > Running Services - add all the numbers on the bottom of the screen
    • check 2: run the following command in adb shell: cat /proc/meminfo/ and note the MemTotal field
  • 检查1:设置>应用程序>运行选项卡 - 在屏幕底部的
  • 添加的所有号码
  • 检查2:运行在亚行的shell下面的命令:执行cat / proc / meminfo中/ ,并记下的 MemTotal 字段
  • check 1: Settings > Apps > Running tab - add all the numbers on the bottom of the screen
  • check 2: run the following command in adb shell: cat /proc/meminfo/ and note the MemTotal field

结论

添加MB作为在一些评论指出,下面可能让你的设备推出,但它没有实际有2 GB的RAM。即使是4.1仿真器,RAM大小为512 MB。

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.

推荐

请使用实际设备进行测试。

Please use an actual device for testing.

这篇关于安卓:无法分配内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆