Running into an OOM crash on-and-off for the past few months. We’ve had to disable the required check on the merge queue since it has been blocking our CI pipeline, which is less than ideal.
Here is the requested info about our setup:
ALM: GitHub
CI system: GitHub Actions (GitHub-hosted runners, ubuntu-*, Azure-backed)
Scanner command:
SonarSource/sonarqube-scan-action@9598b8a83feef37de07f549027fab50ecffe6a6e
with sonar-project.properties at the repo root. Relevant JVM env var:
SONAR_SCANNER_JAVA_OPTS=-Xmx12G -Xms1024m
Languages: TypeScript (primary), with some YAML, CSS, HTML, JSON also scanned
Failed run example: Re-try fix allowing use of modifiers in _filter search · medplum/medplum@1fbd729 · GitHub
Error observed:
The scanner OOMs inside JsSecuritySensorV2 after approximately 20 minutes of analysis (762 files), while processing packages/server/src/index.ts (file 687/762). The JVM was configured with -Xmx12G at the time of the crash.
java.lang.OutOfMemoryError: Java heap space
at scala.collection.immutable.List.prependedAll(List.scala:156)
at scala.collection.IterableOnceOps.toList(IterableOnce.scala:1446)
at scala.collection.IterableOnceOps.toList$(IterableOnce.scala:1446)
at scala.collection.AbstractIterable.toList(Iterable.scala:935)
at com.sonar.a.d.c.b.e.g(SourceFile:152)
at com.sonar.a.d.c.b.e.d(SourceFile:42)
at com.sonar.a.d.c.b.h.g(SourceFile:169)
at com.sonar.a.d.c.at.g(SourceFile:243)
at com.sonar.a.d.c.ap.b(SourceFile:629)
... (repeated flatMap recursion on scala.collection.immutable.List)
at cats.data.IndexedStateT.flatMap$$anonfun$1$$anonfun$1$$anonfun$1(IndexedStateT.scala:45)
at cats.data.OptionT.flatMap$$anonfun$1(OptionT.scala:207)
at cats.data.WriterT.flatMap$$anonfun$1(WriterT.scala:203)
File that triggers the OOM: packages/server/src/index.ts (file 687 of 762 in the JsSecuritySensorV2 pass). This file is the Express server entry point for a large FHIR backend and transitively imports a very large portion of the monorepo.
The analysis seems to be going smoothly until it gets to that file and then after 4 minutes of getting stuck on the specified file, the OOM error occurs.
Here are the logs for the aforementioned run with verbose mode enabled:
oom-sonarqube-cloud-logs.txt (1.6 MB)
Any help in debugging would be greatly appreciated.