Fix OOM build failure: limit ninja parallelism to -j1#37
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fatal error: Killed signal terminated program cc1plus— the kernel OOM killer terminated the C++ compiler mid-build.proxy_session.cppandlib_asio_beast.cppwere 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 themediummachine class.-j1to bothninjainvocations 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