Gradle - won't let you set maxHeapSize?

task test(type: Test, overwrite: true, dependsOn: [setupUser]) {
    maxHeapSize "3000m"
    allJvmArgs "-Xmx3000m"
}

      

Mistake:

* What went wrong:
A problem occurred evaluating root project 'myproject'.
> Could not find method allJvmArgs() for arguments [-Xmx3000m] on root project 'myproject'.

      

No matter what I try, I get heap problems when I run gradle test

. I use1.0-milestone-9

0


source to share


1 answer


The second line ( allJvmArgs "-Xmx3000m"

) is incorrect syntax explaining why Gradle is complaining. The first line ( maxHeapSize "3000m"

) is fine and I would be surprised if it didn't work. "3000m"

may be too high, although it may lead to an error when creating the JVM. Anyway, look for the following debug ( -d

) output :



[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] creating process builder for Gradle Worker 1
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] in directory /xxx
[DEBUG] [org.gradle.process.internal.ProcessBuilderFactory] with argument#0 = -Xmx300m
...
[DEBUG] [org.gradle.process.internal.DefaultExecHandle] Started Gradle Worker 1.

      

+5


source







All Articles