If we run it the pipeline (see below), we get:
java.lang.OutOfMemoryError: Java heap space
If we increase heap, e.g. by setting SONAR_SCANNER_JAVA_OPTS to -Xmx4096m, we get:
Container 'Build' exceeded memory limit.
1. How much memory is allocated to the pipeline?
2. How do we increase it? Some posts suggest adding "size: 4x" or similar but what is this 4x of, and where should we put it?
image: maven:3-jdk-11
clone:
depth: full # SonarQube Cloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarQube Cloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarQube Cloud
caches:
- maven
- sonar
script:
- mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
artifacts:
- target/**
pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
branches:
develop:
- step: *build-test-sonarcloud
pull-requests:
'**':
- step: *build-test-sonarcloud
size: 8x