SonarQube 6.7.3 OutOfMemoryError: Java heap space


(Mihai Cristescu) #1


I have a problem with one of our PL/SQL project analysis which constantly fails. On the other hand, another larger PL/SQL project that is analyzed with the same tool completes successfully. What is the source of this error?

java.lang.OutOfMemoryError: Java heap space
         at org.sonar.server.computation.task.projectanalysis.filemove.FileMoveDetectionStep.computeScoreMatrix(
         at org.sonar.server.computation.task.projectanalysis.filemove.FileMoveDetectionStep.execute(
         at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(
         at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(
         at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(
         at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(
         at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(
         at org.sonar.ce.taskprocessor.CeWorkerImpl$$Lambda$742/812932657.get(Unknown Source)
         at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(
         at Source)
         at java.util.concurrent.Executors$ Source)
         at Source)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ Source)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$ Source)
         at Source)

In server’s, the following have been set:

sonar.ce.javaOpts=-Xmx8G -Xms512m -XX:+HeapDumpOnOutOfMemoryError
sonar.web.javaOpts=-Xmx8G -Xms512m -XX:+HeapDumpOnOutOfMemoryError

In Jenkins job properties for SonarQube Scanner we have the following JVM properties:

-Xmx4g -XX:+UseG1GC

SonarQube Developer Edition 6.7.3
JDK 1.8
Windows 2K8

Can you help?

(Alexandre Gigleux) #2


I don’t know the exact root cause of this problem but what is sure is that it’s failing on the ComputeEngine process, so if you want to try to allocate more memory you should increase the Xmx of the property “sonar.ce.javaOpts”. Note that you need to restart SonarQube when you change a configuration on the file.

Also, I suggest to look at the nature of the SQL files scanned. If you have generated SQL files, it’s kind of useless to scan them because you will probably have no way to change them (unless you can change the software generating them).

(Carmelo Zubeldia) #3

I’ve had the same problem since jenkins. When I try to upload the report generated by Sonar Scanner 3.2 I get the same bug as above.
I’m running tests increasing the maximum memory on sonar.ce.javaOpts=.

Interesting information:
SonarQube Version 7.1 (build 11001) (docker image)
Sonar Scanner 3.2

When I have more information I’ll update this thread.