Reduce jemalloc arena count for Linux musl builds (#58399)

## Why

Reduce idle RSS after Linux musl conversations unload by using roughly one jemalloc arena per four CPUs.

## What changed

Set `JEMALLOC_SYS_WITH_MALLOC_CONF` to `narenas_ratio:0.25` in both Cargo's environment and Bazel's `tikv-jemalloc-sys` build script environment.

GitOrigin-RevId: fa05961f88b2f2e8716b75f5582eecacb2fc5a8e
This commit is contained in:
Dmitriy Kovalenko
2026-10-30 18:02:30 +00:00
committed by copyberry
parent 5be57bedd0
commit a94ba8bdd0
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -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)",
+3
View File
@@ -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"