Sonarqube plugin - how to set memory for findbugs?

sonarqube
plugins

(Vitaly Gorbunov) #1

I have a project module with 30K classes.
After migrating sonar analysis from ant script to gradle plugin I have OOM error with output like this:

13:10:36 Out of memory
13:10:36 Total memory: 954M
13:10:36 free memory: 119M

13:10:52 Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
13:10:52 at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:163)
13:10:52 … 109 more
13:10:52 Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
13:10:52 at

We’ve run ant script with the following parameters “-Xmx3800m -XX:ReservedCodeCacheSize=128m”

How can I set the same parameters for sonarqube gradle plugin?

I’ve tried setting the following env variable before calling gradle
GRADLE_OPTS=-Xmx3800m -XX:ReservedCodeCacheSize=128m
It’s applied correctly, but findbugs still failing and prints “Total memory: 954M”

Also I’ve tried adding the following properties to reduce memory consumption, but without any luck

property 'sonar.skipPackageDesign', 'true'
property 'sonar.skipDesign', 'true'

Gradle version is 3.5
Sonarqube plugin version is 2.5
jdk version is 8u131