Email me

Rust errors / Build and Cargo

Rust build error · checked with Rust 1.99.0

error: could not compile `foo`... process didn't exit successfully (signal: 9, SIGKILL: kill)

error: could not compile `foo`... process didn't exit successfully (signal: 9, SIGKILL: kill)

What it meansThe operating system killed the compiler because it ran out of memory. Common on small CI runners, Docker containers and cheap VPSes, especially with release builds and LTO.

Why it happens

  • Too many parallel rustc jobs for the RAM available.
  • LTO or very large generic-heavy crates.

How to fix it

1. Build with fewer jobs

cargo build --release -j 2

2. Lighter release settings

In Cargo.toml.

[profile.release]
codegen-units = 16
lto = false

3. Add swap on the build machine

sudo fallocate -l 4G /swapfile && sudo chmod 600 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile

Other wordings of this error

signal: 9, SIGKILL: kill, rustc killed signal 9, cargo build out of memory, process didn't exit successfully signal 9

Other build errors

Up next

Find the right pagePaste any Rust errorCompiler codes and build errors in one finder.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ