Does MALLOC_CONF actually work? · Issue #65 · tikv/jemallocator (original) (raw)

Hello, I'm micro-benchmarking Rust allocators (Linux) and I cannot get MALLOC_CONF to work.

[target.'cfg(not(target_env = "msvc"))'.dependencies]
jemallocator = "0.5.4"
jemalloc-ctl = "0.5.4"
#[global_allocator]
#[cfg(not(target_env = "msvc"))]
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn main() {
    use jemalloc_ctl::{epoch, stats, opt};
    println!("tcache {:?}", opt::tcache::read().unwrap());
    println!("tcache_max {:?}", opt::tcache_max::read().unwrap());
    println!("background_thread {:?}", opt::background_thread::read().unwrap());
}
cargo build --release

MALLOC_CONF="background_thread:true,metadata_thp:always,percpu_arena:percpu,tcache_max:131072,tcache:true" ./target/release/faf-allocator-bench
tcache true
tcache_max 32768
background_thread false

Note: