Android Stuido 好卡怎么办?不要急,兄弟来教你
2017-06-01 08:58
274 查看
近期使用Android studio 开发app,编译的时候特别卡,常常卡死。我的机器 i3 + 8G,按道理来说流畅的跑个androidstudio还是绰绰有余的...
于是在各大论坛寻找解决方式,在此记录下来。让同病相连的弟兄们能够早点解脱....
方法一:开启gradle单独的守护进程
在以下的文件夹以下创建 gradle.properties 文件:
- /home/<username>/.gradle/ (Linux)
- /Users/<username>/.gradle/ (Mac)
- C:\Users\<username>\.gradle (Windows)
并在文件里添加:
org.gradle. daemon= true同一时候改动项目下的 gradle.properties 文件也能够优化:
<span style="font-size:14px;"># Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Settings specified in this file will override any Gradle settings # configured through the IDE. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html # The Gradle daemon aims to improve the startup and execution time of Gradle. # When set to true the Gradle daemon is to run the build. # TODO: disable daemon on CI, since builds should be clean and reliable on servers org.gradle.daemon= true # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. # Default value: -Xmx10248m -XX:MaxPermSize=256m org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize= 512 m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF- 8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects org.gradle.parallel= true # Enables new incubating mode that makes Gradle selective when configuring projects. # Only relevant projects are configured which results in faster builds for large multi-projects. # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand org.gradle.configureondemand= true</span>
同一时候上面的这些參数也能够配置到前面的用户文件夹下的gradle.properties文件中。那样就不是针对一个项目生效,而是针对全部项目生效。
上面的配置文件主要就是做, 增大gradle执行的java虚拟机的大小,让gradle在编译的时候使用独立进程,让gradle能够平行的执行。
方法二:添加Androidstudio的执行内存
操作例如以下图:
1。打开 Androidstudio的安装路径下的 bin 文件夹
2,找到 studio.exe.vmoptions 和 studio64.exe.vmoptions 文件
3,改动 以上2个文件里的值 (下图是我改动后)
这些值起码在原有的基础上乘以2。假设是内存壕的话。能够尽可能的大。
我的Androidstudio 经过上述配置后。能够跑得飞起来了,哈啊哈!
!
!
兄弟还在等什么。!飞起来吧!
。骚年
相关文章推荐
- Android Stuido 好卡怎么办?不要急,兄弟来教你
- 兄弟mfc-7220如何取消打印报告?不管是接收还是发送传真,都打印报告出来,这样浪费一张白纸,怎么去掉?
- 非典型性需求管理 I - "你怎么什么都不要"
- MATCH_PARENT与FILL_PARENT:不要做什么和怎么做
- 怎么做产品设计师-不要为了设计而设计
- 编程写一个方法时,注意方法中传参数的数量最好不要超过5个,超过5个怎么办?可以用struct或class,或一个字典类
- [delphi]窗口最大化时怎么才能不要把任务栏盖住
- Win10怎么隐藏桌面回收站图标不要它显示出来
- vs2010 程序语句有错,也报错了 却运行了以前的版本,怎么设置它有错就不要运行了呢?
- 搞j2me开发的兄弟帮忙啊!我的程序怎么连接不了jsp啊!在线等待!马上给分!
- 不要问怎么做,要问为什么做
- Eclipse怎么改变工程,包的展开模式,不要直接展开到有.java文件那一级,而是要显示层级机构
- 我发现,要工资的人比不要工资的人更好伺候,前者只要加钱什么都好办,后者就算加钱也不干。现在人都TMD这么懂享受生活,怎么进步啊。
- 防盗号或炸骗不要输入qq密码怎么去除
- Mysql登录不要密码,怎么设定密码.
- 怎么避免在类实现的cpp文件中不要多次进行类声明
- ORACLE PL/SQL编程之八:把触发器说透(写的太长了,建议没事的时候看,想快速查怎么用触发器的不要看)
- 程序员累了怎么办-兄弟连IT教育
- 怎么避免在类实现的cpp文件中不要多次进行类声明
- 徐小平:不要用兄弟情谊来追求共同利益,要用共同利益追求兄弟情谊