SonarCloud scan fails with exceeded memory limit for large repositories

SonarCloud scan fails with “Container ‘docker’ exceeded memory limit.” for large repositories.
Error: level=error msg="error waiting for container: unexpected EOF"
Tried increasing size to 2x and increasing docker memory to 2048 but these workarounds work only for small repositories and not for large repositories.

Please help us understand what the issue is and how to fix it. Here are some details:

  • ALM used: Bitbucket
  • CI system used: Bitbucket Cloud
  • Scanner command used when applicable (private details masked): pipe: sonarsource/sonarcloud-scan:1.2.1
  • Languages of the repository: JS and typescript
  • Only if the SonarCloud project is public, the URL: NA - it’s a private repo
  • Build logs without sensitive info:

    …Variable type analysis: done
    INFO: Analyzing 1788 ucfgs to detect vulnerabilities.
    INFO: rule: S5144, entrypoints: 502
    INFO: Running symbolic analysis
    INFO: rule: S5144 done
    INFO: rule: S5696, entrypoints: 502
    INFO: Running symbolic analysis
    INFO: rule: S5696 done
    INFO: rule: S5131, entrypoints: 502
    INFO: Running symbolic analysis
    INFO: rule: S5131 done
    INFO: rule: S6096, entrypoints: 502
    INFO: Running symbolic analysis
    INFO: rule: S6096 done
    INFO: rule: S2076, entrypoints: 502
    INFO: Running symbolic analysis
    time=“2021-05-28T18:44:13Z” level=error msg=“error waiting for container: unexpected EOF”

Solved by decreasing xmx

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.