GRADLE_OPTS are for the gradle process itself. Test task forks vms and has its own methods of configuring the vm settings: http://gradle.org/current/docs/dsl/org.gradle.api.tasks.testing.Test.html
Cheers! On Fri, Aug 19, 2011 at 9:28 AM, Brett Cave <[email protected]> wrote: > Hi, > > I have a problem of a custom test task failing with PermGen exception. The > gradle task is run from a java-based CI. The build job has been configured > to run as an "exec" job, which I think the CI runs using JavaExec. > > The job runs gradle with something similar to the following: > GRADLE_OPTS="-XX:MaxPermSize=512m" gradle customTest > > When the tests run and I check the running processes, I see the following 2 > java processes on the system: > 14622 ? Sl 0:43 /usr/java/jdk6-latest/bin/java > -XX:MaxPermSize=512m -Xmx1024m -Xms1024m -classpath > /usr/local/gradle/gradle-1.0-milestone-3/lib/gradle-launcher-1.0-milestone-3.jar > -Dorg.gradle.appname=gradle org.gradle.launcher.GradleMain cleanTestDirs > customTest > 14684 ? Sl 0:04 /usr/java/jdk6-latest/bin/java > -Dcustom.test.variable=Blah -ea -cp > /home/ciuser/.gradle/caches/1.0-milestone-3/workerMain/classes > org.gradle.process.internal.launcher.GradleWorkerMain > > It seems like the main gradle launcher runs with the correct PermGen size, > but the worker that runs does not get these options. > > The custom test task is defined as: > task customTest(type: Test) { > systemProperties "custom.test.variable": > System.getProperty("custom.test.variable","DefaulVal") > testClassesDir = sourceSets.customTest.classesDir > classpath = sourceSets.customTest.runtimeClasspath > include '**/CustomTestSuite.*' > } > > > Am I doing something wrong in the way I configure MaxPermSize? > > -- > > Regards, > Brett > > -- Szczepan Faber Principal engineer@gradleware Lead@mockito
