SonarQube 6.7.3 OutOfMemoryError: Java heap space

Hi,

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(FileMoveDetectionStep.java:198)
         at org.sonar.server.computation.task.projectanalysis.filemove.FileMoveDetectionStep.execute(FileMoveDetectionStep.java:125)
         at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)
         at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
         at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:73)
         at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:134)
         at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:97)
         at org.sonar.ce.taskprocessor.CeWorkerImpl$$Lambda$742/812932657.get(Unknown Source)
         at org.sonar.ce.taskprocessor.CeWorkerImpl.withCustomizedThreadName(CeWorkerImpl.java:81)
         at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:73)
         at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:43)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
         at java.util.concurrent.FutureTask.run(Unknown Source)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
         at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

In server’s sonar.properties, 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

Environment:
SonarQube Developer Edition 6.7.3
JDK 1.8
Windows 2K8
RAM: 16GB

Can you help?

Hello,

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 sonar.properties 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).

1 Like

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.

Greetings,