0

I am using a SonarQube CLI Scanner started from a TFS instance on a Windows Build Agent (Windows 10 Datacenter 64bit) to analyze a (rather large) PHP/JS project.

This used to work well, lately the jobs fail with the SonarQube Scanner reporting:

Could not reserve enough space for 3135488KB object heap

I tried setting

SONAR_SCANNER_OPTS = -Xmx4G

this didn't seem to have any effect though.

Could this be connected to the Java VM (which is 32bit, latest version)? Also, the latest SonarQube runner used by the TFS is listed as version 3.1.1 and seems to have been installed when the problems started. Coincidence?

Is it possible/should I use a 64bit Java VM?

Any advice on how to get this running again would be greatly appreciated.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
taalas
  • 395
  • 3
  • 16
  • How about run the JVM with `-Xmx4G` as [this case](https://stackoverflow.com/questions/4401396/could-not-reserve-enough-space-for-object-heap) mentioned? – Cece Dong - MSFT Feb 01 '18 at 03:29

1 Answers1

1

We don't expect scanner to require such a big amount of memory. Even for a big project, most processing is made file by file, so let say the memory you need depends mainly on the size of the biggest file, not on the number of files. Please try to decrease Xmx parameter (1G should be more than enough). I know that on Windows, it might cause problem (especially on 32 bit).

If you encounter OutOfMemory issues during the analysis, please open a new thread with details on the SonarQube user group so that we can investigate.

  • Thanks for your suggestions. I was under the impression (by reading up on it) that the scanner tried to estimate the memory needed for the operation. My problem was solved by switching to a 64 bit Java VM though which was able to reserve the heap without changing parameters. – taalas Feb 05 '18 at 06:55