BitBucket Cloud + Kotlin + SonarCloud OutOfMemory

H!
Trying to adopt SonarCloud for existing project. Of course started with biggest repository. According to statistics plugin in IntelliJ 75K lines. Enabled SonarCloud as described in setting project.

  • ALM used : Bitbucket Cloud
  • CI system used: Bitbucket Cloud
  • Scanner command used when applicable: Gradle plugin
  • Languages of the repository: Kotlin
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
> Task :app:sonarqube
Task 'sonarqube' is deprecated. Use 'sonar' instead.

Resource not found: com.txxxxxxt.backend.xxxxxxx.services.impl.XXXXServiceImplTest under the directory /opt/atlassian/pipelines/agent/build/app while reading test reports. Please, make sure your "sonar.junit.reportPaths" property is configured properly

> Task :backend-api:sonarqube
Task 'sonarqube' is deprecated. Use 'sonar' instead.

> Task :backend-api:sonarqube FAILED
Exception in thread "HttpClient-1-SelectorManager" java.lang.OutOfMemoryError: Metaspace
Exception in thread "HttpClient-2-SelectorManager" java.lang.OutOfMemoryError: Metaspace
  • Steps to reproduce

Project is gradle multi-project. There is no build.gradle.kts in root directory, only settings.gradle.kts. There is a buildSrc which defines plugins for projects => three scripts: the base which applies basic behaviour for all types of sub projects and one for app, another for library. In base plugin which defines behaviour of any subproject (library and application) defined sonarqube plugin in plugins section. The step in Bitbucket pipeline is configured with 2x size and does build, two sets of tests: normal unit tests and integration tests (and they are not visible in coverage at all), sonar, maven publish and jib. This step utilizes postgres and some other very small service in Go as parts of testbed.

Without sonarqube the step can be built. But with it - out of memory. Any suggestions? Thank you.

Hey there.

To start, take a look at this post:

1 Like