Skip to content

build: allow overriding RSS limit for zig binary manually#23254

Closed
xtexx wants to merge 1 commit intoziglang:masterfrom
xtexx:2025-03-aosc-rss
Closed

build: allow overriding RSS limit for zig binary manually#23254
xtexx wants to merge 1 commit intoziglang:masterfrom
xtexx:2025-03-aosc-rss

Conversation

@xtexx
Copy link
Contributor

@xtexx xtexx commented Mar 15, 2025

The max-RSS value had been bumped for several times during the 0.14.0 release cycle, showing that the current value is very close to the average RSS usage, with few redundant space.

This adds a new option to specify the RSS upper bound for compiling Zig executable file.

On AOSC OS, Zig 0.14.0 (& 0.13.0) fails to build on AArch64 and RISC-V 64, even when there are enough memory available on the build server.
I have not found a minimal repro for this, but compilation does failed when all default settings of AOSC OS were applied.

https://buildit.aosc.io/logs/72701-zig-0.14.0-riscv64-Estelle-buildit2-2025-03-15-03:47:45.txt https://buildit.aosc.io/logs/72698-zig-0.14.0-arm64-Zinfandel-2025-03-14-15:27:52.txt

The max-RSS value had been bumped for several times during the 0.14.0
release cycle, showing that the current value is very close to the
average RSS usage, with few redundant space.

This adds a new option to specify the RSS upper bound for compiling Zig
executable file.

On AOSC OS, Zig 0.14.0 (& 0.13.0) fails to build on AArch64 and
RISC-V 64, even when there are enough memory available on the build
server.
I have not found a minimal repro for this, but compilation does failed
when all default settings of AOSC OS were applied.

https://buildit.aosc.io/logs/72701-zig-0.14.0-riscv64-Estelle-buildit2-2025-03-15-03:47:45.txt
https://buildit.aosc.io/logs/72698-zig-0.14.0-arm64-Zinfandel-2025-03-14-15:27:52.txt

Signed-off-by: Bingwu Zhang <xtex@aosc.io>
xtexx added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Mar 15, 2025
- Update to 0.14.0
- Relax RSS upper bound for ARM64 and RISC-V 64
  ziglang/zig#23254

Co-authored-by: 白铭骢 (Mingcong Bai) (@MingcongBai) <jeffbai@aosc.io>
xtexx added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Mar 15, 2025
- Update to 0.14.0
- Relax RSS upper bound for ARM64 and RISC-V 64
  ziglang/zig#23254

Co-authored-by: 白铭骢 (Mingcong Bai) (@MingcongBai) <jeffbai@aosc.io>
MingcongBai added a commit to AOSC-Dev/aosc-os-abbs that referenced this pull request Mar 17, 2025
- Update to 0.14.0
- Relax RSS upper bound for ARM64 and RISC-V 64
  ziglang/zig#23254

Co-authored-by: 白铭骢 (Mingcong Bai) (@MingcongBai) <jeffbai@aosc.io>
@alexrp
Copy link
Member

alexrp commented Mar 22, 2025

What does getconf PAGESIZE say on the affected systems?

@xtexx
Copy link
Contributor Author

xtexx commented Mar 22, 2025

For the riscv64 one (which produced the build log mentioned in the commit message), 4096, and for arm64, 16384.

@alexrp
Copy link
Member

alexrp commented Mar 24, 2025

I wonder if it would make more sense for zig_max_rss to be null by default and have the specific CI script pass the expected RSS for that platform? cc @jacobly0

@vt-alt
Copy link

vt-alt commented Mar 25, 2025

What is purpose of setting maxrss at all? How we would know in advance what value should be set? (For the downstream distribution building on many architectures. Are we expected to brute forcing the right value with a lot of failing compilations?) And then it will bump again if toolchain/build env is slightly changed? I would appreciate if there is method to remove this [possible arbitrary] limit. 🙏

@alexrp
Copy link
Member

alexrp commented Mar 25, 2025

What is purpose of setting maxrss at all?

The purpose is for us to know if a PR causes the memory usage of the compiler to increase in CI, and to partially prevent OOM situations that kill other jobs on the machine.

@alexrp alexrp closed this in #23525 Jun 3, 2025
Jan200101 pushed a commit to Jan200101/zig that referenced this pull request Jun 9, 2025
We have no control over memory usage on arbitrary systems in the wild. But we
would still like to get the warnings so we can adjust the values based on
observations in the official ZSF CI.

Closes ziglang#23254.
Closes ziglang#23638.
dasimmet pushed a commit to dasimmet/zig that referenced this pull request Aug 4, 2025
We have no control over memory usage on arbitrary systems in the wild. But we
would still like to get the warnings so we can adjust the values based on
observations in the official ZSF CI.

Closes ziglang#23254.
Closes ziglang#23638.
@xtexx xtexx deleted the 2025-03-aosc-rss branch August 30, 2025 00:44
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.

3 participants