> +---------- On Feb 18, Jean-Fabrice RABAUTE said: > > There is no impact on the process memory ! It seems to not work at all. > > It won't release memory back to the OS; it just makes it available for > nsd to use for other things again.
This is what's considered the "high-water mark" approach. The allocator is designed to allocate memory, but not free it (this is an allocator dependent thing, but that's what the one that AOLServer uses). The idea is that if you allocated mem for 20MB worth of array elements, then you will likely need that much again. When you free those 20MB, they are marked reusable in AOLServer though, so you should always see a "high-water mark", rather than constantly increasing memory. For those who worry about "but I only need 20MB once, and then 1MB all the rest of the time", any decent OS with a good VM system (pretty much all nowadays) will just swap those unused pages out anyway. There are ways to change this behavior. Tcl's built-in mem allocator is a high-water mark allocator, but it was only used on Windows and Mac (back when it was faster than their internal ones). In 8.3.4 I changed to use the system allocator on Windows, so it's no longer high-water there. AOLServer uses a special allocator to support thread and obj allocation efficiently, but that could still be modified (perhaps at a performance penalty). In any case - I would like to hear more detail about Jean-Fabrice's problem, because there shouldn't be a clear leak. Jeff Hobbs The Tcl Guy Senior Developer http://www.ActiveState.com/
