【问题】

折腾:

【已解决】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. Java Socket编程readLine返回null,read返回-1的条件

    客户端正常关闭socket的时候,服务器端的readLine()方法会返回null,或者read()方法会返回-1

  2. PCB板的价格是怎么算出来的?

    Part 1 :影响一块PCB板价格的各种因素 PCB的价格是很多采购者一直很困惑的事情,很多人在线下单时也会疑问这些价格是怎么算出来的,下面我们就一起谈论一下PCB价格的组成因素. 1.PCB所用材 ...

  3. java:打包

    包名命名规范: 1.包名全部小写 2.包名一般情况下是域名的倒过来写+个性命名,如:tinyphp.com,就写成com.tinyphp+.xxx 打包方法 package + 包名 package ...

  4. JavaScript中样式,方法 函数的应用

    JavaScript中一个字母都不能错,编写的时候他不报错,也不提示,只有在执行的时候才会提示错误位置 . 一.样式 .waring {background-color:yellow } .highl ...

  5. oracle 修改表的sql语句

    oracle 修改表的sql语句     1增加一个列:ALTER TABLE 表名 ADD(列名 数据类型);如:ALTER TABLE emp ADD(license varchar2(256)) ...

  6. C++:虚基类

    4.4.3 虚基类1.没什么要引入虚基类 如果一个类有多个直接基类,而这些直接基类又有一个共同的基类,则在最底层的派生类中会保留这个间接的共同基类数据成员的多分同名成员.在访问这些同名的成员时,必须在 ...

  7. JCIFS是很不稳定的

    我以前也试过这样登录失败,第二天就能登录成功了. JCIFS是很不稳定的. 如果是域登录可以这样 //DOMAIN_IP         域名服务(其实域名和域名服务器IP可以,不过用IP解析速度快很 ...

  8. ios7 webapp touch bug

    // ios7 touchstart bug if(navigator.userAgent.indexOf("iPhone OS 7") != -1){ var startX = ...

  9. apk反编译(3)smali语法

    from http://pallergabor.uw.hu/androidblog/dalvik_opcodes.html Dalvik opcodes Author: Gabor Paller Vx ...

  10. Codeforces Round #207 (Div. 1)B(数学)

    数学so奇妙.. 这题肯定会有一个循环节 就是最小公倍数 对于公倍数内的相同的数的判断 就要借助最大公约数了 想想可以想明白 #include <iostream> #include< ...