Thursday, June 4, 2015

SonarQube Runner–OutOfMemoryError - Java Heap Space

I’m currently integrating SonarQube in our Build pipeline. During the process I stumbled over some issues. One issue I got was related to the Java runtime running out-of-memory.

The SonarQube Runner will analyze your project and collect and send all the results to your SonarQube database. If your project is large, it can happen that the JVM used behind the scenes runs out of memory.

You have 2 options to fix this:

  • Option 1 - Reduce the analyze scope by either reducing the project size(split your project in smaller sub projects/modules) or reducing the set of rules that are analyzed.
  • Option 2 – Increase the memory size that can be consumed by the JVM.  This can be done by adding the following Environment Variable:
    • SONAR_RUNNER_OPTS=-Xmx1024m -XX:MaxPermSize=512m
image

No comments: