【问题】

折腾:

【已解决】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. winform窗口打开后文本框的默认焦点设置

    原文:http://blog.csdn.net/kongwei521/article/details/6871411 winform窗口打开后文本框的默认焦点设置,进入窗口后默认聚焦到某个文本框,两种 ...

  2. 【redis】02string类型和hash类型

    Redis的数据类型   Redis主要分为五个数据类型,一个是string,最简单的一个数据类型,hash,list, 还有set集合,还有zset有序集合,这是咱们redis的五种基础类型, 接下 ...

  3. poj 1562 Oil Deposits (广搜,简单)

    题目 简单的题目,只是测试案例的输入后面可能有空格,所以要注意一下输入方式. #define _CRT_SECURE_NO_WARNINGS //题目的案例输入n,m后面有些貌似有空格... #inc ...

  4. hdu 1596 find the safest road(最短路,模版题)

    题目 这是用Dijsktra做的,稍加改动就好,1000ms..好水.. #define _CRT_SECURE_NO_WARNINGS #include<string.h> #inclu ...

  5. java基础知识回顾之java集合类-Properties集合

    /** java.lang.Object   |--java.util.Dictionary<K,V>      |--java.util.Hashtable<Object,Obje ...

  6. 使用apt-fast 来加速你的Ubuntu 的apt

    使用apt-fast 来加速你的Ubuntu 的apt sudo add-apt-repository ppa:apt-fast/stable sudo apt-get update sudo apt ...

  7. linux服务器下发送邮件

    系统管理人员经常会遇到对于设备或者任务的预警与通知,通常情况有发送短信.邮件等方式.发送短信一般来说需要有短信猫(硬件)或者调用libfetion给飞信用户发送.本文介绍几种简单的发送邮件的方式. 本 ...

  8. laravel Restful

    参考:http://www.cnblogs.com/youxin/p/3967274.html http://scotch.io/tutorials/simple-laravel-crud-with- ...

  9. 车牌识别LPR(一)-- 研究背景

    在年尾用了几天的时间将2014年的所有工作都总结了一遍,将之前的文档综合了下. 以下是LPR系统,车牌识别的一些总结资料. 第一篇:LPR研究背景 汽车的出现改变了以往出行徒步和以马代步的时代,极大地 ...

  10. Java语言基本语法

    Java语言基本语法 一.标识符和关键字 标识符 在java语言中,用来标志类名.对象名.变量名.方法名.类型名.数组名.包名的有效字符序列,称为“标识符”: 标识符由字母.数字.下划线.美元符号组成 ...