Skip to content
Latchkey

Earthly OOM / killed under high parallelism in CI

BuildKit executes independent targets in parallel. On a memory-constrained runner, many heavy targets running at once can exhaust RAM and the kernel OOM-kills a step, which surfaces as "signal: killed".

What this error means

A build step dies with "process ... did not complete successfully: signal: killed" or the whole job is OOM-killed while several targets run concurrently.

earthly
+compile | c++: fatal error: Killed signal terminated program cc1plus
Error: solve: failed to solve: process "/bin/sh -c make -j" did not complete successfully: signal: killed

Common causes

Too many heavy targets running in parallel

BuildKit parallelizes the graph. Several memory-hungry compiles at once can exceed the runner's RAM and trigger the OOM killer.

An unbounded make/build inside a target

A make -j with no job limit spawns as many compilers as cores, multiplying memory use inside one target.

How to fix it

Cap BuildKit parallelism

Limit how many targets buildkitd runs at once so total memory stays within the runner.

Terminal
export EARTHLY_BUILDKIT_MAX_PARALLELISM=4
earthly +build

Bound job counts inside targets

  1. Set an explicit job limit on make and other parallel tools.
  2. Use a runner with more memory for heavy compiles.
  3. Split very large targets so peak memory is lower.
Earthfile
RUN make -j2

How to prevent it

  • Cap BuildKit parallelism on constrained runners.
  • Bound -j on make and similar tools.
  • Right-size runner memory for the build.

Frequently asked questions

What causes "Earthly "signal: killed" (OOM)"?
BuildKit parallelizes the graph. Several memory-hungry compiles at once can exceed the runner's RAM and trigger the OOM killer.
How do I fix Earthly "signal: killed" (OOM)?
Limit how many targets buildkitd runs at once so total memory stays within the 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