0

I am trying to run the sonar scanner on a docker virtual machine as part of my private Azure DevOps build server and am getting an error with the pagefile not having enough memory to complete the analysis. My docker image is running windows server core 2019 base image with JDK 11.0.13 installed and Sonarqube scanner 5.0.0. The server also has the following environment variables set to try and increase the Java VM size:

JAVA_OPTS="-Xms1024m -Xmx4608m"
SONAR_SCANNER_OPTS="-Xmx4608m"

My image is running with 5GB RAM and monitoring the container is showing that there is plenty of memory still available to use. I have noticed that the first time I run the scan after starting the container it runs fine but each attempt afterwards gets the error:

##[error]Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000789c00000, 703594496, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)

Can someone please help me with why it is failing to allocate around 700MB when there is more than 2GB RAM available.

The versions of everything are: Azure DevOps agents: 2.194.0 JDK: 11.0.13 Sonarqube scanner extension: 5.0.0 Docker: 20.10.7 Docker base image: dotnet/framework/sdk:4.8-gbt-windowsservercore-ltsc2019

John Sharland
  • 53
  • 1
  • 7

1 Answers1

0

The issue turned out to be related to the JavaXmlSensor detecting some very large xml test files in the test project, it was trying to load them into memory and analyse them causing the out of memory error.

To fix it I added **/*.xml to the sonar.exclusions and also added the same list of exclusions to the sonar.test.exclusions setting.

John Sharland
  • 53
  • 1
  • 7