Sonar scan does not complete successfully - JS out of memory exception

Must-share information (formatted with Markdown):

  • SonarQube 8.1, Sonar Scanner 3.1
  • I’m trying to scan my Angular 7 project with the Scanner
  • The command I’m using is npm run sonar --max-old-space-size=12300 which results in:
    1131/3713 files analyzed, current file: src/app/data/users/show/user.mock.ts 09:34:16 ERROR: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memoryINFO:
    09:34:16 INFO:
    09:34:16 INFO: [21303:0x4240520] 826703 ms: Scavenge 1361.6 (1439.6) -> 1346.4 (1440.6) MB, 5.8 / 0.0 ms (average mu = 0.274, current mu = 0.204) allocation failure 09:34:16 INFO: [21303:0x4240520] 827273 ms: Mark-sweep 1361.9 (1440.6) -> 1346.7 (1440.1) MB, 522.8 / 0.0 ms (average mu = 0.253, current mu = 0.228) allocation failure scavenge might not succeed
    09:34:16 INFO: [21303:0x4240520] 827364 ms: Scavenge 1362.3 (1440.1) -> 1347.7 (1440.6) MB, 5.4 / 0.0 ms (average mu = 0.253, current mu = 0.228) allocation failure