【问题】

折腾:

【已解决】Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 8

过程中,增大对应AVD的内存为2G后,结果无法启动AVD了:

[2012-12-18 18:01:38 – Emulator] Failed to allocate memory: 8 
[2012-12-18 18:01:38 – Emulator] 
[2012-12-18 18:01:38 – Emulator] This application has requested the Runtime to terminate it in an unusual way. 
[2012-12-18 18:01:38 – Emulator] Please contact the application’s support team for more information.

【解决过程】

1.所以,重新改小为1G试试:

结果问题依旧。

2.参考:

Android Emulator: Failed to allocate memory: 8 even with 8MB RAM

说是,只能是256/512/1024

但是很明显,我上面改成1024也是不行的。

参考最后一个人的解释,去改为900MB,看到log为:

[2012-12-18 18:16:04 – SDK Manager] Snapshot image already present, was not changed. 
[2012-12-18 18:16:04 – SDK Manager] SD Card already present with same size, was not changed. 
[2012-12-18 18:16:04 – SDK Manager] Updated AVD ‘SamsungGalaxySII’ based on Android 4.2, ARM (armeabi-v7a) processor, 
[2012-12-18 18:16:04 – SDK Manager] with the following hardware config: 
[2012-12-18 18:16:04 – SDK Manager] hw.sdCard=yes 
[2012-12-18 18:16:04 – SDK Manager] hw.device.manufacturer=Google 
[2012-12-18 18:16:04 – SDK Manager] hw.mainKeys=yes 
[2012-12-18 18:16:04 – SDK Manager] hw.lcd.density=240 
[2012-12-18 18:16:04 – SDK Manager] hw.accelerometer=yes 
[2012-12-18 18:16:04 – SDK Manager] hw.dPad=no 
[2012-12-18 18:16:04 – SDK Manager] hw.device.hash=499058361 
[2012-12-18 18:16:04 – SDK Manager] hw.trackBall=no 
[2012-12-18 18:16:04 – SDK Manager] hw.device.name=Nexus S 
[2012-12-18 18:16:04 – SDK Manager] hw.camera.back=none 
[2012-12-18 18:16:04 – SDK Manager] hw.sensors.proximity=yes 
[2012-12-18 18:16:04 – SDK Manager] hw.battery=no 
[2012-12-18 18:16:04 – SDK Manager] disk.dataPartition.size=200M 
[2012-12-18 18:16:04 – SDK Manager] hw.audioInput=yes 
[2012-12-18 18:16:04 – SDK Manager] hw.sensors.orientation=yes 
[2012-12-18 18:16:04 – SDK Manager] hw.camera.front=none 
[2012-12-18 18:16:04 – SDK Manager] hw.gps=yes 
[2012-12-18 18:16:04 – SDK Manager] skin.dynamic=no 
[2012-12-18 18:16:04 – SDK Manager] hw.keyboard=no 
[2012-12-18 18:16:04 – SDK Manager] vm.heapSize=32 
[2012-12-18 18:16:04 – SDK Manager] hw.ramSize=900

然后再去试试,结果错误依旧。

3.改回之前配置的512MB,是可以的。

但是不是我想要的,想要的就是,尽量让内存大点,以此希望能让AVD模拟器跑的快点,不要这么慢。

4.再去改为768MB,结果又显示和之前的snapshot不一致,所以还不给启动:

[2012-12-18 18:19:00 – DownloadSongtasteMusic] —————————— 
[2012-12-18 18:19:00 – DownloadSongtasteMusic] Android Launch! 
[2012-12-18 18:19:00 – DownloadSongtasteMusic] adb is running normally. 
[2012-12-18 18:19:00 – DownloadSongtasteMusic] Performing crifan.com.downloadsongtastemusic.MainActivity activity launch 
[2012-12-18 18:19:00 – DownloadSongtasteMusic] Automatic Target Mode: launching new emulator with compatible AVD ‘SamsungGalaxySII’ 
[2012-12-18 18:19:00 – DownloadSongtasteMusic] Launching a new emulator with Virtual Device ‘SamsungGalaxySII’ 
[2012-12-18 18:19:00 – Emulator] emulator: ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration.

5.所以,先去把snapshot去掉,然后再启动,启动后,关闭掉,再次勾选上snapshot。

结果还是同样提示:

ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration

所以,估计只能是删除掉,重新建一个,也许才可以的。

6.重新新建一个AVD:

然后用这个AVD试试效果。

然后是可以启动的。

不过速度也还是很慢。

6.继续参考该贴,先去设置为1024MB,

然后再去把:

C:\Users\CLi\.android\avd\SamsungGalaxySII.avd\config.ini

中的:

hw.ramSize=1024

改为

hw.ramSize=1024MB

然后去运行试试,结果出现:

Emulator] emulator: ERROR: Unable to load VM from snapshot. The snapshot has been saved for a different hardware configuration.

再去取消掉snapshot,再运行,的确是可以运行的。

【总结】

结论是:

当前有个bug:

默认是通过

hw.ramSize=1024

来判断内存大小的,但是当是>=1024时,就无法正确识别了。

必须手动把对应的

C:\Users\CLi\.android\avd\SamsungGalaxySII.avd\config.ini

中的

hw.ramSize=1024

改为

hw.ramSize=1024MB

就可以了。

提示:

1. 手动改了后,结果会导致界面中无法正确显示:

总之,还是很悲催,bug还是很大的说。

2.虽然改为1024MB,甚至2048MB,但是实际上运行AVD的时候,貌似还是原始的(我所选的那个设备Nexus的)343MB:

总之,更加坑爹。。。

from:http://www.crifan.com/android_emulator_failed_to_allocate_memory_8/

【已解决】Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 8的更多相关文章

  1. 【已解决】Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory

    [已解决]Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 结论是: 当前有个bug: 默认是通过 hw.ramSize=1024 ...

  2. Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 8 (转)

    Android ADT中增大AVD内存后无法启动:emulator failed to allocate memory 8http://www.crifan.com/android_emulator_ ...

  3. 解决webpack项目中打包时候内存溢出的bug JavaScript heap out of memory

    vue 项目 npm run dev 的时候一直卡住不动:后来找到报错是 Ineffective mark-compacts near heap limit Allocation failed - J ...

  4. 将文件从已Root Android手机中copy出来的几个cmd窗口命令

    将文件从已Root Android手机中copy出来的几个cmd窗口命令: 以shell身份登录adbadb shell进入adb后切换至root用户su更改文件的所属chown shell *更改文 ...

  5. Android 启动模拟器是出现“Failed to allocate memory: 8”错误提示的原因及解决办法

    某天,Android 启动模拟器是出现“Failed to allocate memory: 8”错误,模拟器无法启动,如下图: 原因:设置了不正确AVD显示屏模式,4.0版默认的模式为WVGA800 ...

  6. 解决java web中safari浏览器下载后文件中文乱码问题

    解决java web中safari浏览器下载后文件中文乱码问题 String fileName = "测试文件.doc"; String userAgent = request.g ...

  7. 解决Failed to allocate memory: 8转

    解决Failed to allocate memory: 8 昨天换了x64的Win7,发现在Eclipse上启动模拟器的时候存在问题,当设置的模拟器分辨率大于400×800的时候会出现 Failed ...

  8. MySQL在windows系统中修改datadir路径后无法启动问题,报错1067

    windows server2008下如何更改MySQL数据库的目录的帖子已经很多了,这里简单介绍一个步骤,如果不成功请先查看其它帖子. 更改默认的mysql数据库目录 将 C:\Documents ...

  9. 解决Zend OPcache huge_code_pages: mmap(HUGETLB) failed: Cannot allocate memory报错

    前几日看到鸟哥介绍的 <让你的PHP7更快之Hugepage>, 于是想试试手给服务器加上,参照格式安装好扩展,调整好配置文件,然后重启php-fpm,结果启动一直报Zend OPcach ...

随机推荐

  1. dom4j处理xml文件,读取xml字符串,格式化xml文件

    1.xml文件 <?xml version="1.0" encoding="UTF-8"?> <employees> <emplo ...

  2. Public, Private and Protect

    public 意味着在其后声明的所有成员对所有的人都可以取. private 意味着除了该类型的创建者和类的内部成员函数之外,任何人都不能存取这些成员. protect 它与private基本相似,只 ...

  3. JS 变量或参数是否有值的判断

    var node; …… 判断 node 是否有值,是否为 undefine,是否 null,直接使用两个!!,否定之否定: if (!!node){ .... }else{ .... } 这个条件判 ...

  4. [转]Java数组初始化详解

    一维数组1)   int[] a;   //声明,没有初始化 2)   int[] a=new int[5];   //初始化为默认值,int型为0 3)   int[] a={1,2,3,4,5}; ...

  5. python学习[二]

    继续学习 http://www.cnblogs.com/vamei/archive/2012/09/13/2682778.html 词典的每个元素是键值对.元素没有顺序.dic = {'tom':11 ...

  6. 对于linux下system()函数的深度理解(整理)

    原谅: http://blog.sina.com.cn/s/blog_8043547601017qk0.html 这几天调程序(嵌入式linux),发现程序有时就莫名其妙的死掉,每次都定位在程序中不同 ...

  7. 日志logger

    1.使用指定类初始化日志对象 在日志输出的时候,可以打印出日志信息所在类如:Logger logger = LoggerFactory.getLogger(com.Book.class);       ...

  8. mvn 安装ojdbc6.jar

    mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion= - Dpackaging=jar -Dfile ...

  9. 汇编debug 截图2

  10. C++工具系列博文合集

    http://www.cnblogs.com/itech/category/240779.html