On 16.12.2006, at 16:25, Stephen Deasey wrote:
The seem, in the end, to go for Google tcmalloc. It wasn't the absolute fastest for their particular set of tests, but had dramatically lower memory usage.
The down side of tcmalloc: only Linux port. The nedmalloc does them all (win, solaris, linux, macosx) as it is written in ANSI-C and designed to be portable. I tested all our Unix boxes and was able to get it running on all of them. And the integration is rather simple, just add: #include <nedmalloc.c> #define malloc nedmalloc #define realloc nedrealloc #define free nedfree I believe this needs to be done in just one Tcl source file. Trickier part: you need to call neddisablethreadcache(0) at every thread exit. The lower memory usage is important of course. Here I have no experience yet.
Something to think about: does the nedmalloc test include allocating memory in one thread and freeing it in another? Apparently this is tough for some allocators, such as Linux ptmalloc. Naviserver does this.
Are you sure? AFAIK, we just go down to Tcl_Alloc in Tcl library. The allocator there will not allow you that. There were some discussions on comp.lang.tcl about it (Jeff Hobbs knows better). As they (Tcl) just "inherited" what aolserver had at that time (I believe V4.0) the same what applies to AS applies to Tcl and indirectly to us.