Android Studio报错:Unable to start the daemon process: could not reserve enough space for object heap

来源:互联网 发布:女生 投行 知乎 编辑:程序博客网 时间:2024/05/22 13:40

最近在使用Android Studio的时候,爆出了这么一个问题:
Error:Unable to start the daemon process: could not reserve enough space for object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
<em>org.gradle.jvmargs=-Xmx1024m</em>

<a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Read Gradle's configuration guide</a><br><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/vm/gc-ergonomics.html">Read about Java's heap size</a>

提示内存空间不足.可是我8g的内存就开了个qq和android studio 怎么会内存不足呢.记得没换系统之前程序还是能用.换过系统之后.android studio没有重新安装.就不能用了.奇怪的问题,后来在stackoverflow.com 上找到了这个问题的解决办法:

Do Following steps:

  1. Start Android Studio.
  2. Close any open project.Go to File > Close Project.(Welcome window will open)
  3. Go to Configure > Settings.
  4. On Settings dialog,select Compiler (Gradle-based Android Projects) from left and set VM Options to -Xmx512m(i.e. write -Xmx512m under VM Options:) and press OK.
虽然是英语,但是小白的我都看懂了按照他说的做了之后立马就好了.感谢大神
帖子地址:http://stackoverflow.com/questions/25009717/android-studio-gradle-project-unable-to-start-the-daemon-process-initializatio

修改完毕.依然报此错误的话.最好重启一下电脑

0 1