I am trying to run an analysis of a project with 375K lines of code.
- versions used : SonarQube Dev Ed. 8.5.1.38104
- error observed: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “JGit-WorkQueue”
- The SonarQube analysis is being run from within an AzureDevOps Pipeline
- Analysis works if I exclude the unit tests projects (and hence have no code coverage)
- If I include the unit tests I get the following error
##[error]Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "JGit-WorkQueue"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "JGit-WorkQueue"
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 7:12.906s
INFO: Final Memory: 9M/37M
##[error]ERROR: Error during SonarScanner execution
ERROR: Error during SonarScanner execution
INFO: ------------------------------------------------------------------------
##[error]java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
##[error]ERROR:
ERROR:
##[error]The SonarScanner did not complete successfully
The SonarScanner did not complete successfully
##[error]16:47:30.976 Post-processing failed. Exit code: 1
16:47:30.976 Post-processing failed. Exit code: 1
##[error]The process 'E:\Agent\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.17.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe' failed with exit code 1
I have upped the Compute Engine memory to 8192m in the sonar.properties file
sonar.web.javaOpts=-Xmx8192m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
sonar.ce.javaOpts=-Xmx8192m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
and I can see this memory setting in SonarQube admin console
Do I just keep adding more memory or is there another setting to consider?
Note: other than this issue the SonarQube server is behaving as expected