Exit Code 137 (Out of Memory) on CircleCI - Causes and Fixes
By Daniel Zoghalchali·Latchkey
Exit Code 137 (Out of Memory) is an infrastructure failure, not a bug in your code - here is the CircleCI-specific fix.
What this error means
A step or job ends with exit code 137 and often just the word Killed. The process received SIGKILL - on CI runners, almost always the out-of-memory killer.
CircleCI log
KilledProcess completed with exit code 137.
Common causes
The job exceeded the available memory
Bundlers, compilers, and test suites can spike past the runner memory ceiling; the kernel OOM killer terminates the heaviest process with SIGKILL.
A container/heap limit is too low
An explicit memory limit (or a too-small language heap) makes the process hit the wall sooner.
How to fix it
Give it more resources on CircleCI
Increase the resource_class (e.g. resource_class: large or xlarge).
Reduce peak usage
Lower build/test parallelism and cap language heaps (e.g. NODE_OPTIONS=--max-old-space-size) below the runner limit.
How to prevent it
Right-size CircleCI runners/agents for the job.
Cache dependencies to cut time, memory pressure, and network calls.
Use self-healing runners that retry transient and mechanical failures automatically.
Frequently asked questions
What causes "Exit code 137 on CircleCI"?
Bundlers, compilers, and test suites can spike past the runner memory ceiling; the kernel OOM killer terminates the heaviest process with SIGKILL.
How do I fix Exit code 137 on CircleCI?
Increase the resource_class (e.g. resource_class: large or xlarge).
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.