authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-27 04:43:55-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-27 18:05:59+01:00
log523cfabcdff65c9547299b3a4f721d2052c163ee
tree0221101e05b6da78558b5a99687e9fa6e11e0f85
parentb4e21ccb4994d051ecf086491e42f57ce183d9b9

build.zig: hard cap on compiler max_rss at 8G

This number should never be raised. If the value is exceeded, then it is considered a bug in the Zig project that building the compiler takes more than 8G of memory. Partial revert of 1293f080fdfc74966b541b44f0a907561df3d617 Deprioritizes #31510

1 files changed, 4 insertions(+), 1 deletions(-)

build.zig+4-1
...@@ -772,7 +772,10 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu...@@ -772,7 +772,10 @@ fn addCompilerMod(b: *std.Build, options: AddCompilerModOptions) *std.Build.Modu
772fn addCompilerStep(b: *std.Build, options: AddCompilerModOptions) *std.Build.Step.Compile {772fn addCompilerStep(b: *std.Build, options: AddCompilerModOptions) *std.Build.Step.Compile {
773 const exe = b.addExecutable(.{773 const exe = b.addExecutable(.{
774 .name = "zig",774 .name = "zig",
775 .max_rss = 8_700_000_000,775 // This number should never be raised. If the value is exceeded, then
776 // it is considered a bug in the Zig project that building the
777 // compiler takes more than 8G of memory.
778 .max_rss = 8_000_000_000,
776 .root_module = addCompilerMod(b, options),779 .root_module = addCompilerMod(b, options),
777 });780 });
778 exe.stack_size = stack_size;781 exe.stack_size = stack_size;