One malloc to rule them all
blog.reverberate.org
blog.reverberate.org
Has anyone here had the opportunity to test nedmalloc in real life? What sort of performance benefits did you see? Any problems you ran into?
I'm currently designing embedded systems in C, and am looking to get the most performance out of strained resources as possible...
I'm wondering if this'll compile for AVR or not.....
Academic papers: http://rtportal.upv.es/rtmalloc/node/71
That’s the crazy thing about malloc implementations. They
all claim to be awesome in every way. So the burning
question is: is this better than what I’m using today? I
don’t know, but I’d sure like to!
I like the article, but I'm not sure that there needs to be a single winner. Different programs have different needs. Right now, I'd love to find a malloc that can work within shared mmap segments, sort of as described here: http://blog.directededge.com/2009/02/27/on-building-a-stupid...> Although TLSF works rather well in many scenarios, it stands out in applications with hard/soft real-time application which uses explicit memory allocation with high flexibility requirements due to a high variability of the data size or adaptability to new situations.
Or paraphrased: "TLSF is great, but is especially great when..."
In the case that most people care about, I think something like TCMalloc (http://goog-perftools.sourceforge.net/doc/tcmalloc.html) is more appropriate.
Static arrays aplenty will arise
Also) punish them for excessively large static arrays
http://people.freebsd.org/%7Ejasone/jemalloc/bsdcan2006/jema...
I especially like the part near the end of the post where it says, "It could be that different implementations excel in different scenarios" as if that wasn't completely obvious for anyone who has thought for more than a few minutes about a malloc implementation.
And since the malloc() that ships with any given libc is going to be used by 100% of applications that do not explicitly override malloc (and I have never come across an application that does), understanding which is the best all-around allocator seems like quite the worthwhile exercise.
I also don't necessarily buy the jemalloc paper's assertion that allocators cannot be benchmarked in isolation. It's true that you can't measure the effects that locality will have on the rest of the application, but you surely can measure locality of allocations.