Most programs use the system-provided memory allocator.
malloc()
free()
realloc()
memalign()
calloc()
valloc()
Critical for performance, memory footprint and security of a computer program.
Could we upgrade it?
In June 2017 I heard a converstation about a prior effort to do this.
glandium: [We] tried jemalloc 3 and 4. ... the gist of it is that RSS was something like +50% while performance was slightly better, but tweaking to get less memory overhead made the performance not so good anymore.
jesup tested jemalloc 5 in 2023.
December 2022
| jemalloc | ptmalloc | increase | |
|---|---|---|---|
| resident-peak | 479MB | 552MB | 115% |
| resident | 202MB | 504MB | 250% |
pssst. Wait until the end of the presentation...
jesup tested mimalloc in 2023
jesup tested mimalloc in 2023
The implementation is too tightly tied to Chrome's infrastructure to test with Firefox.
A lot of allocators gave a ~5% performance win (at the time) but added a lot more memory overhead.
We'll continue to maintain and improve mozjemalloc.
2 years ago disabling jemalloc yeilded a 5% perf gain.
Today jemalloc is 2.5% faster than the system allocator. And still consumes a lot less memory.