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

3

18

Once in a while I'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,

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

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

Bewick answered 25/9, 2012 at 14:48 Comment(0)
W
13

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

Warnock answered 25/9, 2012 at 15:34 Comment(2)
Try to put a gradle.properties file into the project directory and set standard Java memory options via org.gradle.jvmargs, e.g. org.gradle.jvmargs=-Xms128m -Xmx256m. Could it be that your system is sometimes low on memory?Warnock
Note for Intellij IDEA Users: This solves also almost exactly the same issue in Intellij IDEA 12.1.6, if you try to "Refresh" gradle project in JetGradle window. Please note also that in some situations GRADLE_OPTS environment variable set to -Xmx512m can help (for example without it I was not able to import my Gradle-Project into Intellij IDEA), but then I had anyway to set org.gradle.jvmargs=-Xms128m -Xmx256m in gradle.properties. My setup is: Windows 7 64bit, JDK1.7.0_17 32bit, Gradle 1.8.Janessa
W
34

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

Preferences dialog

Wrinkle answered 4/11, 2013 at 10:34 Comment(1)
This solves my problem for STS! I've been working on this for a whole day! Thanks dude!Puppy
W
13

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

Warnock answered 25/9, 2012 at 15:34 Comment(2)
Try to put a gradle.properties file into the project directory and set standard Java memory options via org.gradle.jvmargs, e.g. org.gradle.jvmargs=-Xms128m -Xmx256m. Could it be that your system is sometimes low on memory?Warnock
Note for Intellij IDEA Users: This solves also almost exactly the same issue in Intellij IDEA 12.1.6, if you try to "Refresh" gradle project in JetGradle window. Please note also that in some situations GRADLE_OPTS environment variable set to -Xmx512m can help (for example without it I was not able to import my Gradle-Project into Intellij IDEA), but then I had anyway to set org.gradle.jvmargs=-Xms128m -Xmx256m in gradle.properties. My setup is: Windows 7 64bit, JDK1.7.0_17 32bit, Gradle 1.8.Janessa
H
5

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).


Solved creating gradle.properties file in project directory(=sts workspace) with content: 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.

Hydrochloride answered 17/7, 2013 at 10:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.