.Net Sonar Scanner OOM

We are experiencing out of memory errors while invoking Sonar scanner for .Net on windows 2016 with OpenJdk 14.OOM.txt (14.7 KB)

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

Native memory allocation (mmap) failed to map 262144000 bytes for Failed to commit area from 0x0000000200000000 to 0x000000020fa00000 of length 262144000.

An error report file with more information is saved as:

C:\Users\Administrator\workspace\nettest_feature_test-windows-oom\hs_err_pid4468.log

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000200000000, 262144000, 0) failed; error=‘The paging file is too small for this operation to complete’ (DOS error/errno=1455)

We also tried increasing the virtual memory (page size) in windows and still have the same issue.

Hello there, @gowthamsig. Could you please tell me how much RAM do you have on this machine? Could you please check RAM usage by sonar-scanner process in the task manager a few moments before having such an error?

@Dmitry_Golovinov We have 16GB of RAM in the machine. Let me get the RAM usage for sonar-scanner process.

I can’t find the java process in Task manager since the jvm invocation fails to start in first place

SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner…

There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (mmap) failed to map 268435456 bytes for Failed to commit area from 0x0000000200000000 to 0x0000000210000000 of length 268435456.
An error report file with more information is saved as:
C:\Users\Administrator\workspace\anagement_feature_test-sonar-oom\hs_err_pid6096.log
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000200000000, 268435456, 0) failed; error=‘The paging file is too small for this operation to complete’ (DOS error/errno=1455)
The SonarQube Scanner did not complete successfully

We have verified it doesn’t consume more than 500-600 MB of memory. However, CPU was spiking between 60-80%.

Thanks for the update. Can I ask you to provide the full log (output of the scanner) when you change the memory limit. I want to see the exact place when this problem happens, as well want to verify that the memory change was effective.

We found the root cause and it was related to Jenkins. We are not seeing this after increasing Winrm remote shell memory limit. Thank you.