Skip to content
Latchkey

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.

github-actions
##[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

  1. Bound peak memory in the tool itself (for example Node's --max-old-space-size or limiting test workers).
  2. Raise or remove an overly low container --memory option.
  3. If the workload truly needs more RAM, select a larger runner.
.github/workflows/ci.yml
- name: Build with bounded heap
  run: node --max-old-space-size=4096 ./node_modules/.bin/build
  env:
    NODE_OPTIONS: --max-old-space-size=4096

How to prevent it

  • Bound peak memory for memory-hungry build and test tools.
  • Match the runner size to the workload's real memory footprint.

Frequently asked questions

What causes ""container ran out of memory (OOMKilled)""?
A build or test run requests more RAM than the runner has, triggering the OOM killer.
How do I fix "container ran out of memory (OOMKilled)"?
Cap tool memory or use a larger runner

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card