Rust automatically chooses the &quot;best&quot; strategy based on how you&#x27;re building the source, per <a href="https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;blob&#x2F;master&#x2F;text&#x2F;1183-swap-out-jemalloc.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rust-lang&#x2F;rfcs&#x2F;blob&#x2F;master&#x2F;text&#x2F;1183-swap...</a><p>If you&#x27;re building a dynamic or static library, we use the system allocator because Rust is &quot;subordinate&quot;. If you&#x27;re building a binary, we use jemalloc because Rust is in control and jemalloc is basically the best allocator in town. These behaviors can be manually overridden, and you can also provide your own custom global allocator (see linked RFC for details).<p>A Rust project using Rust libraries will generally link them in as rlibs, which is basically the Rust equivalent of an object file. rlibs just inherit whatever allocator from what they&#x27;re linked into.