Java.lang.OutofMemoryError : Java heap space, during SonarQube execution for C# code

When I tried to run a static code analysis for C# code in SonarQube, I got an error as Java.lang.OutofMemoryError: Java heap space,


Referring to the documentation to solve the issue,(Ref: implemented the solution.

But still the same issue not resolved. Kindly help me to sort this out.

The settings you changed affect server memory, whereas the scanner is an independent process with its own JVM. You can control the allocation of memory on the scanner side by setting the SONAR_SCANNER_OPTS environment variable as documented here. Increase the -Xmx (max heap space) value until the error is resolved.

I tried setting up a environment variable. Still facing the same issue. Help me resolve the same