【问题】

折腾:

【已解决】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调用dll文件中的类型转换

    char *转String   (env)->NewStringUTF("the content you want to type in"); char *转jbyteArr ...

  2. 建立docker私有hub

    docker是一个非常好用的虚拟化工具. 下面给出建立私有docker hub的方法.docker将私有hub的环境打包在registry image中 执行指令: docker run -p 500 ...

  3. auto_ptr的设计动机

    auto_ptr的设计动机 C++标准程序库提供的auto_ptr是一种智能型指针(smart pointer),帮助程序员防止“被异常抛出时发生资源泄露”. 函数的操作经常依以下模式进行: 1.获取 ...

  4. POJ 2948 Martian Mining(DP)

    题目链接 题意 : n×m的矩阵,每个格子中有两种矿石,第一种矿石的的收集站在最北,第二种矿石的收集站在最西,需要在格子上安装南向北的或东向西的传送带,但是每个格子中只能装一种传送带,求最多能采多少矿 ...

  5. Android 调节当前Activity的屏幕亮度

    调节的关键代码: WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); layoutParams.screenB ...

  6. codeforces D

    D. Mishka and Interesting sum time limit per test 3.5 seconds memory limit per test 256 megabytes in ...

  7. Pythonxy下载链接

    http://pythonxy.connectmv.com/ 版权声明:本文为博主原创文章,未经博主允许不得转载.

  8. 【mongoDB运维篇①】用户管理

    3.0版本以前 在mongodb3.0版本以前中,有一个admin数据库, 牵涉到服务器配置层面的操作,需要先切换到admin数据库.即 use admin , 相当于进入超级用户管理模式,mongo ...

  9. ibatis框架的sqlmapclient接口

    SqlMapClient,是iBatis中的重要接口,这个接口涉及到对SQL映射的执行和批处理. 现在,就先了解它的对query开头方法的定义. 首先是 queryForList 方法: //指定SQ ...

  10. jsp是有自己的编译引擎的

    什么是jsp? JSP(Java Server Pages)是指: 在HTML中嵌入Java脚本代码 由应用服务器中的JSP引擎来编译和执行嵌入的Java脚本代码 然后将生成的整个页面信息返回给客户端 ...