Re: jemalloc to replace default allocator
Re: jemalloc to replace default allocator
- Subject: Re: jemalloc to replace default allocator
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 7 May 2010 12:23:55 +0200
Le 7 mai 2010 à 11:59, Alastair Houghton a écrit :
> On 6 May 2010, at 22:51, Joel Reymont wrote:
>
>> I would like to use jemalloc to replace the system memory allocator in Firefox.
>
> Why do that? My understanding is that jemalloc's primary advantage is massive scalability for heavily threaded code. Firefox isn't *that* heavily threaded, right?
>
> In any event, the system allocator on Mac OS X has always been pretty good, and it looks like the Snow Leopard version is already designed with per-processor "magazines" for small allocations.
>
> Personally, unless you have a really good justification for using jemalloc instead (and I'd argue that, for that, you need measurements showing that it's significantly faster than the system implementation), I'd stick with the system malloc.
> Not only does it mean that Firefox will get faster with every optimisation Apple makes to the system malloc, but it also means that all of the malloc debugging tools and so on will work with Firefox.
>
> Kind regards,
>
Good advices, but how do you perform measurements without a way to replace the system allocator ;-)
Joel, I think you can override malloc default implementation by using DYLD_INSERT_LIBRARIES and DYLD_FORCE_FLAT_NAMESPACE to inject your malloc library at launch runtime.
But I agree with Alastair, I doubt you get any performance improvement using a custom allocator. The system allocator is pretty good for general purpose applications (like Firefox)
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden