8 releases

0.3.0 Apr 10, 2019
0.2.0 Feb 16, 2019
0.1.5 Feb 16, 2019
0.1.3 May 28, 2018

#492 in Memory management

Download history 921/week @ 2025-10-22 1397/week @ 2025-10-29 3517/week @ 2025-11-05 1102/week @ 2025-11-12 2173/week @ 2025-11-19 1497/week @ 2025-11-26 2045/week @ 2025-12-03 1177/week @ 2025-12-10 1733/week @ 2025-12-17 1440/week @ 2025-12-24 2037/week @ 2025-12-31 1655/week @ 2026-01-07 1194/week @ 2026-01-14 1558/week @ 2026-01-21 1699/week @ 2026-01-28 2176/week @ 2026-02-04

6,952 downloads per month
Used in 6 crates

MIT/Apache

8KB

tcmalloc

A drop-in GlobalAlloc implementation using tcmalloc from gperftools.

Travis badge crates.io badge

Usage

Requires Rust 1.28+

extern crate tcmalloc;

use tcmalloc::TCMalloc;

#[global_allocator]
static GLOBAL: TCMalloc = TCMalloc;

Also note that you can only define one global allocator per application.

By default this crate expects to link to a system-installed tcmalloc. To build the bundled copy of tcmalloc, enable the "bundled" feature. Note the caveats about profiling and libunwind/libgcc on 64-bit linux — they are not built by this crate, and tcmalloc will silently link to versions of both that can cause profiling deadlocks.

Dependencies