mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-14 19:27:01 -04:00
Installed RAM overcommits a busy machine: on a 32 GB desktop with browsers, a VM and editors open, about 7 GB was free and the installed-RAM rule chose 16 jobs. A fresh build then pushed free RAM below 1 GB. `cargo xtask ci` now uses one build job per 1.5 GB of RAM available when it starts (Linux MemAvailable, Windows AvailableMBytes, macOS free + inactive + speculative pages), capped at the CPU count. With line-table debuginfo, 4 jobs measured about 3 GB in use, so this leaves about half the available RAM spare. If available RAM can't be read, half the installed RAM is assumed; if neither can, 4 jobs. Test threads follow, capped at 4. Explicit CARGO_BUILD_JOBS / RUST_TEST_THREADS still win. Co-Authored-By: Claude Opus 5.5 <[email protected]>