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

#532 in Memory management

Download history 1558/week @ 2026-01-21 1699/week @ 2026-01-28 2116/week @ 2026-02-04 2537/week @ 2026-02-11 1888/week @ 2026-02-18 1579/week @ 2026-02-25 2245/week @ 2026-03-04 6090/week @ 2026-03-11 2857/week @ 2026-03-18 1717/week @ 2026-03-25 1678/week @ 2026-04-01 2139/week @ 2026-04-08 3191/week @ 2026-04-15 2497/week @ 2026-04-22 2742/week @ 2026-04-29 2873/week @ 2026-05-06

11,603 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