Could not reserve enough space for object heap for compileTestScala


I’m experiencing some difficulties with Gradle 2.0 while compiling my tests in Scala. The process always report that it is unable to reserve the needed space for object head. This doesn’t seems to even if I modify GRADLE_OPTS or JAVA_OPTS.

Any idea?

thanks, françois-

gradle compileTestScala -i

… :xxx:compileTestJava (Thread[main,5,main]) completed. Took 0.007 secs. :xxx:compileTestScala (Thread[main,5,main]) started. :xxx:compileTestScala Executing task ‘:xxx:compileTestScala’ (up-to-date check took 0.166 secs) due to:

Output file D:\src\xxx\build\classes\test has changed.

Output file D:\src\xxx\build\classes\test\com\xxx\glgeneration\logicx\GlGenerationLoggerTest.class has changed.

Output file D:\src\xxx\build\classes\test\com\xxxglgeneration\logicx\GlGenerationReversalServiceImplTest$$anonfun$3.class has changed. Starting process ‘Gradle Compiler Daemon 1’. Working directory: D:\src\fa Command: C:\Users\mosipova\app\jdk1.7.0_51\bin\java.exe -Dscalac.patmat.analysisBudget=4096 -XX:MaxPermSize=512m -Xms64m -Xmx1 024m -Dfile.encoding=windows-1252 -cp C:\fsarradin\app\gradle-2.0\lib\gradle-base-services-2.0.jar;C:\fsarradin\app\gradle-2.0\lib\gradle-core-2.0.jar;C:\fsarradin\app\gradle-2.0\lib\gradle-cli-2.0.ja r;C:\fsarradin\app\gradle-2.0\lib\gradle-native-2.0.jar;C:\fsarradin\app\gradle-2.0\lib\gradle-messaging-2.0.jar;C:\fsarradin\app\gradle-2.0\lib\slf4j-api-1.7.5.jar;C:\fsarradin\app\gradle-2.0\lib\log back-classic-1.0.13.jar;C:\fsarradin\app\gradle-2.0\lib\logback-core-1.0.13.jar;C:\fsarradin\app\gradle-2.0\lib\jul-to-slf4j-1.7.5.jar;C:\fsarradin\app\gradle-2.0\lib\guava-jdk5-17.0.jar ocess.internal.launcher.GradleWorkerMain Successfully started process ‘Gradle Compiler Daemon 1’ Error: Could not create the Java Virtual Machine. Error occurred during initialization of VM Could not reserve enough space for object heap

Could not write standard input into: Gradle Compiler Daemon 1. Le canal de communication est sur le point dÆÛtre fermÚ

at Method)





at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$

at java.util.concurrent.ThreadPoolExecutor.runWorker(

at java.util.concurrent.ThreadPoolExecutor$

at Error: A fatal exception has occurred. Program will exit. :xxx:compileTestScala FAILED :xxx:compileTestScala (Thread[main,5,main]) completed. Took 0.467 secs.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:xxx:compileTestScala’. > Process ‘Gradle Compiler Daemon 1’ finished with non-zero exit value 1

This means that your machine doesn’t have enough free memory to start the compiler daemon.

Hmm! I’ve 7 GB remaining.

Not sure what the problem is then. Maybe your OS isn’t able to reserve the necessary amount of memory for a single process, or your JDK isn’t. Try to reconfigure the memory settings of the ‘ScalaCompile’ tasks (‘tasks.withType(ScalaCompile) { … }’). See the Gradle Build Language Reference for API details.