Background

Jason Evans edited this page Jan 30, 2017 · 7 revisions

History

jemalloc started out as the memory allocator for a programming language runtime Jason Evans was developing in 2005, but language design changes made the allocator superfluous. At the time, FreeBSD was in need of an SMP-scalable allocator, so he integrated jemalloc into FreeBSD's libc, and then made a long series of improvements to scalability and fragmentation behavior.

In late 2007, the Mozilla Project was hard at work improving Firefox's memory usage for the 3.0 release, and jemalloc was used to solve fragmentation problems for Firefox on Microsoft Windows platforms. You can read here about the fruits of that labor. Many general jemalloc enhancements resulted from Firefox-related efforts. More recently, in 2010 Mozilla sponsored integration of Apple Mac OS X support into the stand-alone jemalloc, and in 2012 contributed MinGW Windows support.

Starting in 2009, Jason Evans adapted jemalloc to handle the extreme loads Facebook servers commonly operate under, and added numerous features that support development and monitoring. Facebook uses jemalloc in many components that are integral to serving its website. Facebook supports numerous open source projects, and is to thank for sponsoring many jemalloc features.

Intended use

jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. It is intended for use as the system-provided memory allocator, as in FreeBSD's libc library, as well as for linking into C/C++ applications. jemalloc provides many introspection, memory management, and tuning features beyond the standard allocator functionality. As an extreme example, arenas can be used as pool allocators; i.e. an arena can be used for general purpose allocation, and then the entire arena destroyed as a single operation.

Adoption

Major uses of jemalloc include:

Additional documentation

The following documentation is dated or otherwise unsuited to wiki form: