Heapspace Error

Existing version of Sonarqube : * Community Edition * Version 7.7 (build 23042)
Database : SQL Server 2016 Standard

What is the Max Heap space parameter can be used as JVM options . Tried Xmx512m, Xmx1024m and Xmx2048m. 1024 & 2048 optons are throwing error “Could not reserve enough space for 2097152KB object heap”

While uploading sonar analysis files (50MB), system throws exception like JVM Heapspace error.

Following are error details.
14:48:43 INFO: ------------------------------------------------------------------------ 14:48:43 INFO: EXECUTION SUCCESS 14:48:43 INFO: ------------------------------------------------------------------------ 14:48:43 INFO: Total time: 2:27.497s 14:48:43 INFO: Final Memory: 45M/358M 14:48:43 INFO: ------------------------------------------------------------------------ 14:49:22 FATAL: Remote call on JNLP4-connect connection from XXXXXXXXXXXXXXXXXXXX failed 14:49:22 java.lang.OutOfMemoryError: Java heap space 14:49:22 Caused: java.io.IOException: Remote call on JNLP4-connect connection from XXXXXXXXXXXXXXXXXXX failed 14:49:22 at hudson.remoting.Channel.call(Channel.java:961) 14:49:22 at hudson.FilePath.act(FilePath.java:1069) 14:49:22 at hudson.FilePath.act(FilePath.java:1058) 14:49:22 at hudson.FilePath.list(FilePath.java:1892) 14:49:22 at hudson.FilePath.list(FilePath.java:1876) 14:49:22 at hudson.FilePath.list(FilePath.java:1861) 14:49:22 at hudson.plugins.sonar.utils.SonarUtils.extractReportTask(SonarUtils.java:89) 14:49:22 at hudson.plugins.sonar.utils.SonarUtils.addBuildInfoTo(SonarUtils.java:118) 14:49:22 at hudson.plugins.sonar.utils.SonarUtils.addBuildInfoTo(SonarUtils.java:134) 14:49:22 at hudson.plugins.sonar.SonarRunnerBuilder.perform(SonarRunnerBuilder.java:301) 14:49:22 at hudson.plugins.sonar.SonarRunnerBuilder.perform(SonarRunnerBuilder.java:247) 14:49:22 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) 14:49:22 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741) 14:49:22 at hudson.model.Build$BuildExecution.build(Build.java:206) 14:49:22 at hudson.model.Build$BuildExecution.doRun(Build.java:163) 14:49:22 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) 14:49:22 at hudson.model.Run.execute(Run.java:1853) 14:49:22 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 14:49:22 at hudson.model.ResourceController.execute(ResourceController.java:97) 14:49:22 at hudson.model.Executor.run(Executor.java:427)

This usually comes from two things:

  • Not enough system memory to reserve the heap space defined
  • Using a 32-bit JVM (you should use a 64-bit JVM)

I’d recommend checking on those things