diff --git a/MODULE.bazel b/MODULE.bazel index 66f6054c12..1d00dc338f 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -679,6 +679,7 @@ crate.annotation( # The musl CLI's allocator needs declared native tools and consistent header flags. crate.annotation( build_script_env = { + "JEMALLOC_SYS_WITH_MALLOC_CONF": "narenas_ratio:0.25", "MAKE": "$${pwd}/$(MAKE)", "NM": "$${pwd}/$(execpath @llvm//tools:llvm-nm)", "RANLIB": "$${pwd}/$(execpath @llvm//tools:llvm-ranlib)", diff --git a/codex-rs/.cargo/config.toml b/codex-rs/.cargo/config.toml index 652e09e7fc..2de645c21e 100644 --- a/codex-rs/.cargo/config.toml +++ b/codex-rs/.cargo/config.toml @@ -1,4 +1,7 @@ [env] +# Roughly one arena per four CPUs reduces idle RSS after Linux musl conversations unload. +JEMALLOC_SYS_WITH_MALLOC_CONF = "narenas_ratio:0.25" + # curl-sys enables its NTLM sources but does not set the flag required by libcurl 8.21. CFLAGS_aarch64_pc_windows_gnullvm = "-DCURL_ENABLE_NTLM" CFLAGS_aarch64_pc_windows_msvc = "-DCURL_ENABLE_NTLM"