Scalable memory allocation using jemalloc
Jan 3, 2011Jason Evans

Summary
This post details the integration and enhancement of jemalloc, a memory allocator, to address critical challenges in Facebook's server applications. It highlights improvements in allocation speed, consistency of RAM usage by reducing fragmentation, and enhanced memory heap profiling capabilities. The post outlines core jemalloc algorithms and data structures, and details Facebook-motivated innovations focused on speed (rewriting thread caching, increasing mutex granularity, optimizing dirty page purging, and developing a new red-black tree implementation) and introspection (exposing statistics via mallctl* API).