On 22.12.2006, at 18:20, Vlad Seryakov wrote:
Another nice thing, you do not need to recompile Tcl, it can be built with zippy, and then just LD_PRELOAD or can be compiled into the main program on OSX directly and its functions will be used instead of later-linked Tcl ones.
Last minute update to that: I just found out that even on Mac OSX you can preload a libaray, w/o requirement of having flat namespace linkage (what we don't). It is similar to LD_PRELOAD: export DYLD_INSERT_LIBRARIES=<whatever_lib>.dylib and off you go! I believe this is after 10.4.0 OSX (but not 100 %sure). The "crucial" part of vmalloc is as I see mmap. I do not get any significant reduction in overall memory footprint when many threads are created/exited. For example, I start 150 threads and the memory footprint goes to about 380-420 MB (Mac OSX). Then I stop all those threads and I get down to about 320-330 MB. I believe the effect of vmalloc is not really visible unless you use mmap to allocate memory.