Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Mar 2006 00:14:25 -0800
From:      Jason Evans <jasone@FreeBSD.org>
To:        bert hubert <bert.hubert@netherlabs.nl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: unsatisfying c++/boost::multi_index_container::erase	performance on	at least FreeBSD 6.0
Message-ID:  <441A6FE1.4010909@FreeBSD.org>
In-Reply-To: <20060317075459.GA24298@outpost.ds9a.nl>
References:  <20060316224912.GA14905@outpost.ds9a.nl>	<441A150A.6000003@FreeBSD.org> <20060317075459.GA24298@outpost.ds9a.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
bert hubert wrote:
> Thanks Jason, this has helped narrow down the problem significantly. From
> this I understand that to work around this problem, I have some options:
> 
> 1) tweak my code to not allocate such a large amount of small objects
> 2) move away from malloc/free based c++ allocators
> 3) recompile libc with jemalloc
> 
> I'm really hoping for 4) where I can LD_PRELOAD only jemalloc, would that
> be possible? Or does libc include parts of malloc/free itself inlined?
> 
> I'd hate to force PowerDNS users to recompile their libc for me :-)

Yes, you should be able to use LD_PRELOAD to pre-load a shared library 
that has nothing but malloc.o in it.  In order to build jemalloc on 6.x, 
you will also need sys/tree.h from -current.

If you are using pthreads on an SMP system, you will either need to 
increase the number of libc spinlocks in libpthread, or use 
MALLOC_OPTIONS to make sure that a small enough number of arenas is used.

Jason



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?441A6FE1.4010909>