Glibc Enables a Per-Thread Cache for Malloc – Big Performance Win
phoronix.com
phoronix.com
I wonder how long it'll take for this implementation to shake out the many bugs (fragmentation issues / worse case behavior) the early version of jemalloc/tcmalloc suffered from.
I'm a little shocked it wasn't already the default.
It's also not true that glibc's malloc has no arenas (which someone may interpret that way); they are just not tied to threads. For something like twenty years, glibc's malloc has had thread support roughly as follows: a thread walks a list of arenas and tries to acquire one without blocking. Then it allocates from that arena. So it's not exactly like there is one big lock around malloc. But threads don't have affinity to go to the same arena.