Unable to create Java Virtual Machine Error while running analysis

(Nikitha Appana) #1

Version Used :: SonarQube 7.3 integrated with TC using SonarScanner using version sonar-scanner-msbuild.

Error received

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.*
Invalid maximum heap size: -Xmx14336m*
The specified size exceeds the maximum representable size.*
Process returned exit code 1*
The SonarQube Scanner did not complete successfully*
Creating a summary markdown file…*
Post-processing failed. Exit code: 1*
Process exited with code 1*

Steps Taken

I tried various values of Xmx and elastic search Xmx values to get over the error, but the MSbuild step which is inbetween the begin and end analysis steps runs for almost 6 hrs and fails at the end analysis step. Just to add into perspective I am scanning over 10M Loc

History of the problem
The solution scan did work in the past with sonar runner version and when I took over the project 6 months ago I upgraded Sonar to 6.7 LTS and integrated it with TC, the project had failed to run with the same error in the past and I left it intermittently, I recently restarted it with another upgrade to Sonar 7.3. I am really stuck on getting this issue resolved and be able to re-run the scans.

(Colin Mueller) #2


Please do not post duplicate threads

That said, your issue smells a little like this issue posted on StackOverflow. You could try lowering your heap size but better yet, make sure you’re running a 64 bit JVM. I would suspect something changed on your build machines with regard to the Java installation.

A reminder that anything set in sonar.propeties (as you mentioned in your other thread) is only relevant on the server-side, not the scanning side. Setting JVM options for the Scanner is done as documented here.

(Note: the latest version of the SonarQube Scanner for MSBuild is 4.3.1)


(Adam Gabryś) #3

This question is everywhere :wink: