Skip to content

Fix OOM build failure: limit ninja parallelism to -j1#37

Merged
Jackarain merged 1 commit into
masterfrom
chunk/fix-oom-ninja-parallelism
Jun 16, 2026
Merged

Fix OOM build failure: limit ninja parallelism to -j1#37
Jackarain merged 1 commit into
masterfrom
chunk/fix-oom-ninja-parallelism

Conversation

@circleci-app

@circleci-app circleci-app Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Job 2020 failed with fatal error: Killed signal terminated program cc1plus — the kernel OOM killer terminated the C++ compiler mid-build.
  • Root cause: proxy_session.cpp and lib_asio_beast.cpp were both compiling in parallel. These are large C++20/template-heavy files that each consume several GB of RAM. Together they exceeded the ~7.5 GB available on the medium machine class.
  • Fix: add -j1 to both ninja invocations in the Dockerfile so only one compilation job runs at a time, keeping peak memory within the machine's limit.

Trade-off

Build time will increase since compilation is now serial, but the build will succeed reliably. A future improvement could be upgrading the CircleCI resource class (e.g. large = 4 vCPU / 15 GB) and reverting to -j2, which would give back parallelism while staying well within the memory envelope.

https://app.circleci.com/agents/gh/Jackarain/chat/f9a87aad-e303-47b9-8286-d937bd07af45

The build was killed by the OOM killer during compilation of
proxy_session.cpp and lib_asio_beast.cpp. Both large C++20 files
were compiling simultaneously on the 2 vCPU / 7.5 GB machine class,
exhausting available RAM.

Limiting ninja to -j1 ensures only one compilation job runs at a time,
preventing peak memory from exceeding the machine limit. Applies to
both the OpenSSL and WolfSSL build variants.

AI-Generated: true
@Jackarain Jackarain merged commit aacf12b into master Jun 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant