jemalloc 3 performance vs. mozjemalloc

Jason Evans jasone at
Wed Feb 18 22:21:34 PST 2015

On Feb 18, 2015, at 1:34 AM, Mike Hommey <mh at> wrote:
> [...] I spotted something "interesting" in
> it generates size classes for large allocations up to close to the
> entire size of the address space, which, apart from being completely
> unrealistic on 64 bits, and kind of crazy on 32 bits, is completely
> useless since those classes are not ever used, since jemalloc switches
> to huge allocations for size >= chunksize (simplifying a bit), and
> AFAICT, huge allocations don't rely on size2index/index2size.
> So in practice, only 68 of the 108 classes on 32 bits systems are ever
> used with 4MB chunks, and 68 of the 236 classes on 64 bits systems.

Indeed, on 64-bit systems the size classes starting at ~2^48 aren't usable in practice, and a handful of size classes are unusable on 32-bit systems as well, but the size classes are used for huge allocations up to the limits imposed by virtual memory.  The only practical implication of having more size classes than can ever be used is that the index2size_tab and size2index_tab tables are a bit bigger than absolutely necessary.


More information about the jemalloc-discuss mailing list