我正在尝试创建一个具有 2047 mb 内存的模拟器.当我运行它时,我得到了这个错误:
[2011-02-22 14:24:14 - 模拟器][2011-02-22 14:24:14 - Emulator] 此应用程序已请求运行时以不寻常的方式终止它.[2011-02-22 14:24:14 - Emulator] 请联系应用程序的支持团队以获取更多信息.[2011-02-22 14:24:26 - 模拟器] 分配内存失败:8
我知道降低数字会使它起作用.但我宁愿拥有更多的内存,这样我就可以测试我正在开发的游戏.我假设有更多的内存,它会运行得更快......
有人在模拟器上安装了 2047 mb 的内存吗?如果是这样,怎么做?您使用了哪些设置?您是否更改了计算机上的任何特别内容?
使用windows 7 64位,更新到最新的android sdk.我还有超过 8gb 的可用内存.我确实有一个设备(摩托罗拉里程碑)可以测试,但是由于它是一个基于网络的游戏,除了我的手机之外,我还需要至少一个其他客户端(希望使用模拟器)来运行.
运行更快的模拟器的解决方案:
http://androiddevnotes.com/2011/03/08/1299521520000.htmlp>
让我的游戏运行速度更快,堪比手机质量.
-- 2012 年 8 月 24 日更新--
我看到仍然有人来这里评论这个答案,我对这个问题做了更多的研究.我向您介绍我的发现结果.
注意:这些测试是在我的电脑上运行的,您的电脑可能不同.
cat/proc/meminfo/
并注意 MemTotal 字段cat/proc/meminfo/
并注意 MemTotal 字段结论
添加 'MB'(如下面的一些评论中所述)可能会允许您的设备启动,但它实际上没有 2 GB 的 RAM.即使使用 4.1 模拟器,RAM 大小也为 512 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...
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.
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.
这篇关于Android:分配内存失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!