1

I'm getting the following trying to run Cobertura as part of my Gradle build.

:cobertura
Instrumenting classes for Cobertura
Exception in thread "Test worker" java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space

I've tried bumping up DEFAULT_JVM_OPTS/-XX:MaxPermSize in my gradle wrapper script, to no effect. Is there a more direct (and effective) way to do this?

David Moles
  • 48,006
  • 27
  • 136
  • 235

2 Answers2

1

Try to set a GRADLE_OPTS environment variable, or a org.gradle.jvmargs property in gradle.properties.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259
1

The only thing that worked for me was changing the .bashrc on my Linux box to have export _JAVA_OPTIONS='-XX:MaxPermSize=512m' Proof that this got detected by gradle when I built was shown with this message: Picked up _JAVA_OPTIONS: -XX:MaxPermSize=512m

Jason D
  • 8,023
  • 10
  • 33
  • 39