JavaScript heap out of memory

Hi,
i use sonarcloud with my bitbucket project,
it work correctly for the pull request , but for other branches they pass but in the step 5 in the annlyse i get this error “JavaScript heap out of memory” like in the photo `

and this is the pipeline

clone:
  depth: full # SonarCloud scanner needs the full history to assign issues properly

definitions:
  services:
    docker-with-large-memory:
      memory: 5120
      type: docker
  caches:
    sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
  steps:
    - step: &build-test-sonarcloud
        size: 2x
        name: Build, test and analyze on SonarCloud
        caches:
          - node
          - sonar
        script:
          - yarn install
          - pipe: sonarsource/sonarcloud-scan:1.4.0
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}
              SONAR_SCANNER_OPTS: -Xmx5120m
        services: [docker-with-large-memory]
    - step: &check-quality-gate-sonarcloud
        size: 2x
        name: Check the Quality Gate on SonarCloud
        script:
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.6
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}

pipelines:
  pull-requests:
    "**":
      - step: *build-test-sonarcloud
      - step: *check-quality-gate-sonarcloud

  branches:
    "{develop}":
      - step:
          name: Install dependencies
          caches:
            - node
          script:
            - yarn install
     - step: *build-test-sonarcloud
     - step: *check-quality-gate-sonarcloud

Hi,

Welcome to the community!

Could you try adding more memory for Node? The docs should help.

 
Ann

i used EXTRA_ARGS: -Dsonar.javascript.node.maxspace=16384
but the same issue

plz can you reply me

Hi,

If 16384 wasn’t enough, perhaps you should try a bigger number?

 
Ann

i tried more and the same thing

Hi,

Keep going.

 
Ann