Error code 137 during sonar-scanner execution

Must-share information (formatted with Markdown):

  • SonarQube 10.2.1-Enterprise, sonar-scanner 5.0.1
  • how is SonarQube deployed: Helm
  • what are you trying to achieve: Scan a C/C++ Project
  • what have you tried so far to achieve this: -

I recently updated to 10.2.1 (without changing the sonar-scanner version) and got this error message for the first time:

I noticed that the sonar-scanner is failing with error code 137, which according to what I can find from the Java docs means it’s running into OOM issues. I tried setting -Xmx to a higher value than default (up to 66G), but it still fails with the same error.

This makes me think there is some memory leak in sonar-scanner, since with default Java settings it scanned for years without issue, and now 66GB is not enough.

I’m guessing some new code is triggering this, but I’m not getting much info out of the system.

Any idea what could be the issue?

1 Like


Can you post the full text of your analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.


@ganncamp I found that setting the JVM memory with -Xmx had no effect. After looking at htop running the analysis on my computer I saw that we need a high amount of RAM per process, and these subprocesses don’t seem to be affected by SONAR_SCANNER_OPTS. After halving the number of processes I was able to run analysis again.

Maybe it would be good if sonar-scanner could detect how much RAM is available and then limit parallelism if it expects spawinng a new thread will break the RAM limits.