Reduce peak memory usage during release builds to fix OOM on manylinux runners#1445
Open
kevinjqliu wants to merge 2 commits intoapache:mainfrom
Open
Reduce peak memory usage during release builds to fix OOM on manylinux runners#1445kevinjqliu wants to merge 2 commits intoapache:mainfrom
kevinjqliu wants to merge 2 commits intoapache:mainfrom
Conversation
kevinjqliu
commented
Mar 27, 2026
| sudo swapoff -a || true | ||
| sudo rm -f /swapfile | ||
| sudo fallocate -l 16G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=16384 | ||
| sudo fallocate -l 8G /swapfile || sudo dd if=/dev/zero of=/swapfile bs=1M count=8192 |
Contributor
Author
There was a problem hiding this comment.
we dont need all 16GB, take less disk space
Closed
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.
Which issue does this PR close?
Follow up to #1443
Closes #1429
Rationale
As the dependency tree has grown (DataFusion + Substrait + Arrow + object_store with aws/gcp/azure/http features), the release build's peak memory during LTO linking has exceeded what the GitHub runner can provide.
Fixes OOM (
Killed process ... (rustc) total-vm:25086084kB, anon-rss:15361808kB) during manylinux x86_64 release builds, whererustcconsumed ~15 GB and exhausted the runner's memory.What changes are included in this PR?
Cargo profile (
Cargo.toml):lto = true) to thin LTO (lto = "thin") -- this is the biggest win, reducing peak memory by ~50-70% since LLVM no longer needs to merge all bitcode into a single modulecodegen-unitsfrom 1 to 2 -- splits LLVM's workload, further reducing peak RSSCI workflow (
.github/workflows/build.yml):build-manylinux-x86_64job as a safety net (matching the existing pattern in the aarch64 job)build-manylinux-aarch64swap from 16 GB to 8 GB for consistencyTradeoffs
Thin LTO + codegen-units=2 may produce binaries that are ~1-4% slower in micro-benchmarks vs fat LTO + codegen-units=1. In practice, this is unlikely to be measurable for a Python extension where the Python-Rust FFI boundary and PyArrow serialization dominate execution time.