cargo test --workspace results in excessive memory usage
Open
A-Build-System
C-Performance
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
On my machine with 24 vCPUs and 32GiB of RAM, running `cargo test --workspace` consumes all available memory and provokes the OOM killer. In particular, attempting to compile 24 examples at once seems to be too much.
This can be mitigated by passing the `-j` option to `cargo test` with a smaller number of jobs (`-j8` worked for me). The `build.jobs` config value can also control the number of jobs globally. However, the high memory usage seems to be confined to compiling examples -- I can build 24 library crates at once with no issue -- and it seems suboptimal to make all builds slower to avoid problems with examples in particular.
Contributor guide
Assessment
This issue has not been assessed yet.