3

I have Sonarqube up and running with postgres db. I am using Sonar-scanner to scan for errors in multiple source codes which I have collected in another postgres db. As soon as I scan about 5 to 6 codes (each of around 10 lines maximum), the scanner starts failing with "insufficient memory for JRE to continue" error, not being able to malloc around 300mb of memory.

Is there a way I can optimize sonarqube to minimize memory usage, as I believe it is eating up all my memory very quickly, perhaps by clearing cache etc. each time I run the scanner?

UPDATE

I updated my Java from java version "1.7.0_95" to java version "1.8.0_77" and now I get a different error saying "Cannot allocate memory" and the following:

# There is insufficient memory for the Java Runtime Environment to continue.

# Native memory allocation (mmap) failed to map 65536 bytes for committing reserved memory.

Community
  • 1
  • 1
np20
  • 1,935
  • 3
  • 16
  • 24
  • What is the SonarQube version and the version of the used JRE? Did you try to analyse your source with a minimum set of plugins? – Jeroen Heier Apr 08 '16 at 14:23
  • SonarQube version is 5.4. and java version "1.7.0_95". I ran it with the default settings, without any additional plugins – np20 Apr 08 '16 at 14:29
  • You are running a JRE that is no longer supported; please consider using JRE 8u77 and retry your case. – Jeroen Heier Apr 09 '16 at 06:48
  • updated to JRE 8u77, but I get another error now, which I have now updated in the question. – np20 Apr 13 '16 at 15:02

1 Answers1

1

Check your available OS memory and adjust JVM parameters accordingly.

Also read Sonar requirements.:

The SonarQube server requires at least 2GB of RAM to run efficiently and 1GB of free RAM for the OS.

rkosegi
  • 14,165
  • 5
  • 50
  • 83
  • I am also getting this error in my Jenkins build, but only with Standalone SonarQube Analysis step, not normal MSBuild steps. OS: Windows Server 2012 R2 , 64 bit Build 9600 (6.3.9600.17415) CPU:total 4 (1 cores per cpu, 1 threads per core) family 6 model 45 Memory: 4k page, physical 16776692k(1830788k free), swap 20970996k(14632k free) vm_info: Java HotSpot(TM) 64-Bit Server VM (25.91-b14) for windows-amd64 JRE (1.8.0_91-b14), built on Apr 1 2016 00:58:32 by "java_re" with MS VC++ 10.0 (VS2010) time: Wed Jul 13 14:48:47 2016 elapsed time: 7 seconds (0d 0h 0m 7s) – Jirong Hu Jul 13 '16 at 19:25