Hacker News new | past | comments | ask | show | jobs | submit login

Kind of a tangent, but does anyone know why glibc’s allocator loses to jemalloc on common workloads? I would expect that would be something worth rectifying unless other requirements tie their hands.



Quite a few complaints about jemalloc from Rust, where people wonder about higher than necessary memory usage

jemalloc likely wins more for the kinds of allocations you find in scripting language runtimes, which also happens to be similar to a browser given DOM & JS

See also: https://sourceware.org/glibc/wiki/389-ds-malloc


> Kind of a tangent, but does anyone know why glibc’s allocator loses to jemalloc on common workloads?

Jemalloc implements more complex strategies (per-thread caches learned from tcmalloc, preallocated arenas, …).

It tends to have a somewhat higher memory use than simpler allocators, but have faster throughput and less fragmentation (the latter is why Firefox switched to jemalloc by default IIRC).

> I would expect that would be something worth rectifying unless other requirements tie their hands.

Why? If they consider ptmalloc good enough for their purpose, replacing it would be very low priority, and they may value e.g. code simplicity higher.

Incidentally, there was talk at one point to replace glibc's ptmalloc: https://sourceware.org/ml/libc-alpha/2014-10/msg00419.html




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: