Android的工作室摇篮无法预留对象堆足够的空间 [英] Android Studio Gradle Could not reserve enough space for object heap

查看:390
本文介绍了Android的工作室摇篮无法预留对象堆足够的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装的Andr​​oid 1.1.0工作室。像开始新的Andr​​oid应用程序或输入任何东西我没有做任何事情。不知怎的,它正在努力建立的东西,它抛出同步错误。


  

错误:无法启动守护进程。
  这个问题可能是由后台程序的配置不正确引起。
  例如,无法识别的JVM选项使用。
  请参考上守护进程在用户指南章在<一个href=\"http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html\">http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html


请阅读下面的过程输出,以了解更多:


  虚拟机初始化期间发生

错误
  无法预留对象堆足够的空间
  无法创建Java虚拟机。


我在 gradle.org /.../ gradle_daemon.html 已签,但无法找到任何东西,可以帮助我解决这个问题。

因为我的物理内存和没有其他程序运行8GB这不是一个内存问题。任何人都可以给一些这方面的暗示吗?


解决方案

有关Android的工作室1.3:(方法1)

第1步:打开 gradle.properties 文件在你的Andr​​oid Studio项目

第二步:在文件的最后添加这一行

  org.gradle.jvmargs = -XX \\:MaxHeapSize \\ =256米-Xmx256m

以上方法似乎可行,但如果在情况下,它不会那么做(方法2)

第1步:启动Android的工作室,并关闭所有打开的项目(文件>关闭项目

第二步:在欢迎窗口中,依次转到配置>设置

第三步:依次转到构建,执行,部署>编译

第四步:更改构建进程堆大小(兆字节)1024 其他构建过程VM选项-Xmx512m

第五步:关闭或重新启动Android的工作室

I've installed Android Studio 1.1.0. I haven't done anything yet like start new Android application or import anything. Somehow it is trying to build something and it throws sync error.

Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example, an unrecognized jvm option is used. Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html

Please read the following process output to find out more:

Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.

I've already checked at gradle.org/.../gradle_daemon.html but couldn't find anything that helps me to solve the problem.

It isn't a memory problem because I've 8GB of physical memory and no other program running. Can anybody give some hint on this, please?

解决方案

For Android Studio 1.3 : (Method 1)

Step 1 : Open gradle.properties file in your Android Studio project.

Step 2 : Add this line at the end of the file

org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m

Above methods seems to work but if in case it won't then do this (Method 2)

Step 1 : Start Android studio and close any open project (File > Close Project).

Step 2 : On Welcome window, Go to Configure > Settings.

Step 3 : Go to Build, Execution, Deployment > Compiler

Step 4 : Change Build process heap size (Mbytes) to 1024 and Additional build process to VM Options to -Xmx512m.

Step 5 : Close or Restart Android Studio.

这篇关于Android的工作室摇篮无法预留对象堆足够的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆