OutOfMemoryError PermGen space when running Sonar Runner

I get an error when applying the Sonar Runner plugin in Gradle. Error message is OutOfMemoryError: PermGen space, apparently running PMD. How we can specify -XX:MaxPermSize=512M to the PMD process that’s ultimately started by SonarRunner. I’m using Java 6 due to project internal needs Another error I’m seeing: > java.lang.VerifyError: (class: org/picocontainer/PicoLifecycleException, method: getMessage signature: ()Ljava/lang/String; ) Illegal constant pool index

Currently, the Sonar Runner gets executed inside the Gradle JVM. (This will likely change in the future.) The best way to control memory settings for the Gradle JVM is via ‘org.gradle.jvmargs=…’ in ‘gradle.properties’.

Using what you suggest with the right hand side -XX:MaxPermSize=512M makes “gradle sonarRunner” run to completion. Thanks.

We use sonarRunner with a 64bit JVM (Win7 64bit) and the settings below (don’t remember where I got those from).

-Xmx16G -Xms4G