Stream: t-compiler

Topic: jemalloc


nikomatsakis (Nov 13 2018 at 14:40, on Zulip):

I see that config.toml.example changed, we now have:

# Link the compiler against `jemalloc`, where on Linux and OSX it should
# override the default allocator for rustc and LLVM.
#jemalloc = false

Did we change to not use jemalloc by default? Anybody know?

I bet @Alex Crichton or @simulacrum does =)

Alex Crichton (Nov 13 2018 at 14:55, on Zulip):

@nikomatsakis yeah jemalloc is no longer the default

gnzlbg (Nov 13 2018 at 16:28, on Zulip):

@nikomatsakis rustc still uses it though in the platforms that it was using it before - rust programs do not.

nikomatsakis (Nov 13 2018 at 16:29, on Zulip):

how do I just make it not be used at all?

nikomatsakis (Nov 13 2018 at 16:29, on Zulip):

I usually disable it everywhere by default

nikomatsakis (Nov 13 2018 at 16:29, on Zulip):

so that things like valgrind etc work better

nikomatsakis (Nov 13 2018 at 16:29, on Zulip):

but I can't tell what's needed now

gnzlbg (Nov 13 2018 at 16:29, on Zulip):

@jemalloc supports valgrind on linux only

gnzlbg (Nov 13 2018 at 16:29, on Zulip):

so you want to disable it in rustc ? let me check

gnzlbg (Nov 13 2018 at 16:30, on Zulip):

@nikomatsakis https://github.com/rust-lang/rust/pull/55660

gnzlbg (Nov 13 2018 at 16:33, on Zulip):

sorry wrong one: https://github.com/rust-lang/rust/pull/55238

gnzlbg (Nov 13 2018 at 16:33, on Zulip):

RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --enable-lldb --set rust.jemalloc"

gnzlbg (Nov 13 2018 at 16:34, on Zulip):

If you don't --set rust.jemalloc it shouldn't use it.

gnzlbg (Nov 13 2018 at 16:34, on Zulip):

in your config.toml you just put jemalloc = false

gnzlbg (Nov 13 2018 at 16:34, on Zulip):

like so: https://github.com/rust-lang/rust/pull/55238/files#diff-c18ae2d8b23f1968bca15e8e349dbbf3R401

the config.toml.example has it commented out

nikomatsakis (Nov 13 2018 at 16:44, on Zulip):

right, it looks like it defaults to false

nikomatsakis (Nov 13 2018 at 16:44, on Zulip):

which suggests to me that it does not use jemalloc at all

nikomatsakis (Nov 13 2018 at 16:44, on Zulip):

at least, I interpret that was "uncomment is a no-op"

gnzlbg (Nov 13 2018 at 16:48, on Zulip):

looking through the code, it indeed appears to be disabled by default =/

gnzlbg (Nov 13 2018 at 16:49, on Zulip):

you can use strings/nm to check for jemalloc symbols in your binary to triple check

gnzlbg (Nov 13 2018 at 16:49, on Zulip):

e.g. nm rustc | grep -E "nallocx"

Last update: Nov 16 2019 at 01:05UTC