From e2816716a0d51eedb715f4eb94b3c108e42c2b43 Mon Sep 17 00:00:00 2001 From: dm9pZCAq <46228973+dm9pZCAq@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:31:28 +0000 Subject: [PATCH] feat: improve jemalloc memory efficiency (#1689) --- .cargo/config.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..e3e5301c --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,10 @@ +[env] +# environment variable for tikv-jemalloc-sys +# +# https://jemalloc.net/jemalloc.3.html#opt.narenas +# narenas is the maximum number of arenas to use for automatic multiplexing +# of threads and arenas. The default is four times the number of CPUs, +# or one if there is a single CPU. +# +# Improve memory efficiency by reducing fragmentation and ensuring all threads allocate from the same pool +JEMALLOC_SYS_WITH_MALLOC_CONF = "narenas:1"