Increasing permgen space for Cobertura ant task running from Gradle

别等时光非礼了梦想. 提交于 2019-12-23 03:56:05

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!