问题
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?
回答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
回答2:
Try to set a GRADLE_OPTS
environment variable, or a org.gradle.jvmargs
property in gradle.properties
.
来源:https://stackoverflow.com/questions/21491450/increasing-permgen-space-for-cobertura-ant-task-running-from-gradle