Out of memory error while scanning

msbuild
scanner
memory

(Rob Duff) #1

I receive an out-of-memory stack trace when scanning a project:

Versions:

  • SonarQube 6.7.5 (build 38563)
  • SonarQube Scanner for Jenkins Plugin v2.8.1
  • Sonargraph Plugin v1.6.4
  • Sonar Gerrit Plugin v2.3
  • Jenkins v2.138.2

The Jenkins plugin "SonarScanner for MSBuild is set to install the version called:
‘SonarScanner for MSBuild 4.4.2.1543 - .NET Fwk 4.6’

java.lang.OutOfMemoryError: GC overhead limit exceeded
	at org.sonar.plugins.xml.highlighting.XMLHighlighting.addHighlighting(XMLHighlighting.java:248)
	at org.sonar.plugins.xml.highlighting.XMLHighlighting.highlightStartElement(XMLHighlighting.java:160)
	at org.sonar.plugins.xml.highlighting.XMLHighlighting.highlightXML(XMLHighlighting.java:93)
	at org.sonar.plugins.xml.highlighting.XMLHighlighting.<init>(XMLHighlighting.java:58)
	at org.sonar.plugins.xml.XmlSensor.runChecks(XmlSensor.java:104)
	at org.sonar.plugins.xml.XmlSensor.execute(XmlSensor.java:154)
	at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
	at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
	at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
	at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:88)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:177)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:291)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:286)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:284)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:264)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
	at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
	at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:121)
	at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:121)
	at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:71)
	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)

(Pierre-Yves Nicolas) #2

It seems that your problem is due to syntax highlighting for XML. That part was recently rewritten.

Can you try to upgrade SonarXML to its latest version?