Good morning! Have you tried increasing memory with SONAR_SCANNER_OPTS
environment variable?
In order to see that this increase was successful - you can check your log files for the presence of line INFO: SONAR_SCANNER_OPTS=....
. I would recommend trying out -Xmx8G
in your case (check https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/). If you don’t see this line in the log file - that means that your adjustments are not effective.
Please, see related topic - SonarQube analysis hangs in the "Running Tarjan" step or throws OutofMemoryError
Also, please consider updating to the latest version of SonarQube if it’s possible.