Subject: Re: Importing jemalloc
To: Andrew Doran <email@example.com>
From: David Laight <firstname.lastname@example.org>
Date: 01/21/2007 10:23:34
On Sun, Jan 21, 2007 at 05:09:03AM +0000, Andrew Doran wrote:
> I ported FreeBSD's new malloc code (jemalloc) to NetBSD's libc. The main
> advantage this brings is significantly reduced contention for multi-threaded
> programs that use malloc heavily.
> For single threaded programs, it seems that jemalloc might have lower or
> comparable CPU and memory footprints when compared against phkmalloc. There
> is a paper at the URL below. If you go up a directory or two, there are more
> interesting files.
I surprised they are using a 'binary buddy' scheme, they tend to be a
recusive PITA for MP systems.
Also that document doesn't describe the problem of data allocated by one
thread, but freed by another. Which requires you acquire the correct
lock for the arena into which the data will be freed.
David Laight: email@example.com