These are some replacements for jemalloc I found on the internet. Some of them 
might not be suitable for our use cases.

mimalloc by Microsoft - They claim it has better performance than jemalloc and 
tcmalloc. It is also used for Bun, a javascript runtime for Node.js. Security 
features like "guard pages, randomized allocation, encrypted free lists, etc" 
can be achieve with the hardened version with 10% performance penalty.

tcmalloc by Google - Used by Google projects, but I'm not sure how  Google's 
Bazel build system can be transformed well to our BSDmake. (No one wants 
complicated makefiles, especially for malloc and libc) It is only supported on 
Linux, so we need extra effort to port them to FreeBSD.

Hoard - "malloc that can dramatically improve application performance, 
especially for multithreaded programs running on multiprocessors and multicore 
CPUs". Does not have any security feature on the README file. No support for 
FreeBSD yet.

rpcmalloc - "lock free thread caching 16-byte aligned memory allocator 
implemented in C". No support for FreeBSD yet.

Mesh - "a drop in replacement for malloc(3) that can transparently recover from 
memory fragmentation without any changes to application code." But like 
tcmalloc, it uses Bazel build system. No support for FreeBSD yet.

snmalloc by Microsoft - David's suggestion. Yet mimalloc also provides some 
security features ("guard pages, randomized allocation, encrypted free lists, 
etc. to protect against various heap vulnerabilities") as well. Still in 0.x 
stage.

snmalloc and mimalloc look great for me, but my only concern is that snmalloc 
is still in 0.x stage.

On Monday, June 9th, 2025 at 7:17 PM, Warner Losh <i...@bsdimp.com> wrote:

> I still think it would be useful to import the version that Minsoo
> started (I've re-created the import he did in a way I (or anybody) can
> 100% audit).. I've not had the couple of adjacent days to get this
> in... It's >< close.
>
>
> I'm unsure what to do in the future. What are all the cool kids using today?
>
> Warner
>
> On Mon, Jun 9, 2025 at 2:08 PM Minsoo Choo minsoochoo0...@proton.me wrote:
>
> > As of June 2, 2025, jemalloc repository on Github has been archived. [1]
> > I have a differential revision open for jemalloc 5.3.0 [2], but have no 
> > idea how we will fix bugs and improve jemalloc on FreeBSD after the archive.
> >
> > We could fork the repository to freebsd/jemalloc and continue to develop by 
> > ourselves. Then, we need to build our own CI systems for jemalloc to test 
> > on macOS/Linux as well.
> >
> > I CC'ed Warner as he guided me for D41421, so I'm seeking for his advice 
> > this time as well.
> >
> > [1] https://github.com/jemalloc/jemalloc
> > [2] https://reviews.freebsd.org/D41421

Reply via email to