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.