Skip to content
Latchkey

Azure Pipelines Out of Memory / Agent Process Killed

A build process exhausted memory on the agent, so the kernel OOM-killed it (often exit code 137) and the job failed.

What this error means

A step fails with an out-of-memory error or is abruptly killed; container jobs frequently show exit code 137. The same heavy step fails under memory pressure.

azure-pipelines
##[error]The operation was canceled.
Container exited with code 137 (Out of memory)

Common causes

Undersized agent memory

The agent or container has too little RAM for the workload.

Memory-hungry build

A compile or test step needs more memory than available.

Too many parallel processes

High parallelism in one step exhausts memory.

How to fix it

Increase available memory

  1. Use a larger agent or raise the container memory limit.
  2. Cap build-tool heap or parallelism to fit available RAM.
azure-pipelines.yml
steps:
  - script: NODE_OPTIONS=--max-old-space-size=4096 npm run build

How to prevent it

  • If you run on GitHub Actions, self-healing managed runners such as Latchkey auto-retry transient failures, so a one-off OOM does not fail the job. On Azure DevOps, right-size agent memory and limit parallelism.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →