SonarScanner cli unexpected OOM

Versions in use

  • SonarQube Server: v2025.6.1 (build 117629), Enterprise Edition

  • SonarScanner / Scanner CLI

    During scan, we got next error:

ERROR: Job failed (system failure): Error in container build: exit code: 137, reason: ‘OOMKilled’

SonarScanner cli

07:07:08.551 INFO  SonarScanner CLI 8.0.1.6346
07:07:08.556 INFO  Linux 6.12.58 amd64
07:07:09.733 INFO  Communicating with SonarQube Server 2025.5.0.113872
07:07:09.734 INFO  JRE provisioning: os[linux], arch[x86_64]
07:07:10.049 INFO  Starting SonarScanner Engine...
07:07:10.049 INFO  Java 17.0.13 Eclipse Adoptium (64-bit)

After upgrade to 2025.6.1
SonarScanner cli

09:24:53.015 INFO  SonarScanner CLI 8.0.1.6346
09:24:53.025 INFO  Linux 6.12.58 amd64
09:24:54.984 INFO  Communicating with SonarQube Server 2025.6.1.117629
09:24:54.985 INFO  JRE provisioning: os[linux], arch[x86_64]
09:24:55.688 INFO  Starting SonarScanner Engine...
09:24:55.689 INFO  Java 21.0.9 Eclipse Adoptium (64-bit)

SonarScanner CLI is now encountering unexpected out-of-memory (OOM) errors. Before upgrading SonarQube from 2025.5.0 to 2025.6.1, we did not see OOM issues, even when scanning small projects.

Also, after upgrading SQ to 2025.6.1, we noticed that jobs started executing longer than usual
on 2025.5.0 it was 27 -30 mins and on 2025.6.1 - 45-50 mins.

Hi,

Could you add -Dsonar.verbose=true to your analysis command line and post the full log, please?

 
Thx,
Ann

We will add -Dsonar.verbose=true, and I’ll send you the log afterward.

To address OOM issues on small jobs, we added:
SONAR_SCANNER_JAVA_OPTS: -Xmx1024m -XX:MaxMetaspaceSize=256m

This change helped us avoid OOM errors.

1 Like