Re:Reducing Memory Usage in Ruby
by masklinn on Wednesday January 24, 2018 @03:42AM
(#16221284)
> 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.
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