Eclipse Gradle STS 扩展:无法为对象堆保留足够的空间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12585506/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:03:33  来源:igfitidea点击:

Eclipse Gradle STS Extension: Could not reserve enough space for object heap

javaeclipsejvmgradlests-springsourcetoolsuite

提问by user1329572

Once in a whileI'll get the following error when the Gradle STS extension tries to execute my project's gradle build script after launching Eclipse 3.7 (Indigo) with the Gradle STS extension installed,

有时,当 Gradle STS 扩展在安装了 Gradle STS 扩展的情况下启动 Eclipse 3.7 (Indigo) 后尝试执行我的项目的 gradle 构建脚本时我会收到以下错误,

Unable to start the daemon process. The exit value was: 1.
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/current/userguide/gradle_daemon.html
Please read below process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Could not fetch model of type 'EclipseProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.0-bin.zip'.

And here are my system specs:

这是我的系统规格:

  • Windows 7 32-bit
  • Eclipse 3.7 32-bit
  • Java jdk1.7.0_07 32-bit
  • 视窗 7 32 位
  • Eclipse 3.7 32 位
  • Java jdk1.7.0_07 32位

Is this a known bug with this plugin? Any idea on how to fix it?

这是该插件的已知错误吗?关于如何修复它的任何想法?

采纳答案by Peter Niederwieser

Sounds like once in a while, your system can't reserve enough memory to start the Gradle daemon. Does the project have a gradle.propertiescontaining memory settings (org.gradle.jvmargs)? Or, do you have a gradle.propertiesin ~/.gradle?

听起来有时,您的系统无法保留足够的内存来启动 Gradle 守护程序。项目是否有gradle.properties包含内存设置 ( org.gradle.jvmargs)?或者,你有gradle.properties~/.gradle 吗?

回答by flup

In eclipse, go to Window, Preferences, Gradle, Arguments and add the gradle jvmargs -Xms128m -Xmx512min the dialog:

在 Eclipse 中,转到 Window、Preferences、Gradle、Arguments 并在对话框中添加 gradle jvmargs -Xms128m -Xmx512m

Preferences dialog

首选项对话框

回答by user2590805

I had same problem with Gradle projects importing. (Windows 7 64-bit, sts-3.2.0.RELEASE 32bit, Java jdk1.7.0_13 32-bit).

我在导入 Gradle 项目时遇到了同样的问题。(Windows 7 64 位,sts-3.2.0.RELEASE 32 位,Java jdk1.7.0_13 32 位)。



Solved creating gradle.propertiesfile in project directory(=sts workspace) with content: org.gradle.jvmargs=-Xms128m -Xmx512m.

解决了在项目目录(=sts 工作区)中创建gradle.properties文件的问题,内容为:org.gradle.jvmargs=-Xms128m -Xmx512m



Note that -Xmx=512m is max size of JVM memory I can use on my system. Bigger Xmx memory sizes leads to described error.

请注意,-Xmx=512m 是我可以在我的系统上使用的 JVM 内存的最大大小。更大的 Xmx 内存大小会导致所描述的错误。