Skip to content
Latchkey

Bitbucket OOM: Process Killed (exit code 137)

Exit code 137 means a process received SIGKILL - almost always the OOM killer reclaiming memory after the process exceeded the container budget. The command did not "fail" logically; it was killed for using too much memory.

What this error means

A command exits with 137 with no clear error of its own, often mid-build or mid-test. It typically follows rising memory use and is resolved by more memory or a lighter process.

bitbucket-pipelines
Killed
command terminated with exit code 137

Common causes

Process exceeded the container memory

The OOM killer terminates the largest offender when the container runs out of memory. Exit 137 is the SIGKILL signature.

Unbounded heap or parallelism

A JVM/Node process with no memory cap, or too many parallel workers, grows past the budget and is killed.

How to fix it

Give more memory and cap the process

Raise the step size and bound the process memory.

bitbucket-pipelines.yml
- step:
    size: 2x
    script:
      - export NODE_OPTIONS=--max-old-space-size=3072
      - npm run build

Reduce peak memory

  1. Lower parallel worker counts (test runners, bundlers).
  2. Stream or chunk large data instead of loading it all in memory.
  3. Set explicit heap limits for JVM/Node processes.

How to prevent it

  • Cap heap and worker counts to fit the container budget.
  • Right-size the step for the workload's peak memory.
  • Stream large data rather than buffering it entirely.

Frequently asked questions

What causes "exit code 137"?
The OOM killer terminates the largest offender when the container runs out of memory. Exit 137 is the SIGKILL signature.
How do I fix exit code 137?
Raise the step size and bound the process memory.
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.

Related guides

References

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