GitHub Actions container job killed with OOMKilled
A process in a container job allocated more memory than the runner provided, so the kernel killed it. The job ends with exit code 137 (128 + SIGKILL). On Latchkey managed runners, an OOM from a transient memory spike is auto-retried, but a workload that consistently needs more memory should move to a larger runner.
What this error means
A memory-heavy step (bundler, compiler, test suite) dies abruptly with exit code 137 and an OOMKilled indication.
##[error]The operation was canceled.
Container exited with code 137 (OOMKilled)Common causes
Workload exceeds available memory
A build or test run requests more RAM than the runner has, triggering the OOM killer.
Memory limit set too low on the container
A --memory option capped the container below what the workload needs.
How to fix it
Cap tool memory or use a larger runner
- Bound peak memory in the tool itself (for example Node's --max-old-space-size or limiting test workers).
- Raise or remove an overly low container --memory option.
- If the workload truly needs more RAM, select a larger runner.
- name: Build with bounded heap
run: node --max-old-space-size=4096 ./node_modules/.bin/build
env:
NODE_OPTIONS: --max-old-space-size=4096How to prevent it
- Bound peak memory for memory-hungry build and test tools.
- Match the runner size to the workload's real memory footprint.