Search code examples
sonarqubetfs-2015sonarqube-scan

SonarQube 6.4.0.25310 with TFS out of memory exception


I use the newest SonarBuild server and the SonarQube TFS extention (not the runner .bat) to build our .net applications,

TFS Extention

the builds runs on build-agents, and at some Projects i have got folowing OutOfMemoryError exception:, i read some threads about it already, where people writing something about inscrease or setup heap-memory of the Java runtime, but i don't understand how to do that, where i have to paste the options e.t.c. I have almost neither experience with java.

[error]Exception in thread "Report about progress of Javascript analyzer" Exception in thread "CHECKPOINT_WRITER" Exception in thread "CLEANUP_MANAGER" java.lang.OutOfMemoryError: GC overhead limit exceeded
[error]at java.util.Arrays.copyOfRange(Unknown Source)
[error]at java.lang.String.<init>(Unknown Source)
[error]at java.lang.StringBuilder.toString(Unknown Source)
[error]at org.sonar.squidbridge.ProgressReport.run(ProgressReport.java:64)
[error]at java.lang.Thread.run(Unknown Source)
[error]java.lang.OutOfMemoryError: GC overhead limit exceeded
[error]at com.persistit.Persistit.closeZombieTransactions(Persistit.java:1706)
[error]at com.persistit.Persistit.cleanup(Persistit.java:1529)
[error]at com.persistit.CleanupManager.poll(CleanupManager.java:157)
[error]at com.persistit.CleanupManager.runTask(CleanupManager.java:88)
[error]at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
[error]at java.lang.Thread.run(Unknown Source)

Solution

  • The error occurs on scanner side. You can try to increase memory of the scanner by setting environment variable SONAR_SCANNER_OPTS=-Xmx1500m prior to the end step. But the error likely come from the analysis of a big JavaScript file that is probably not your code but some third party library, and this could be solved by excluding those files from the analysis (using sonar.exclusions property on scanner side, of directly in the server UI).