Forum .LRN Q&A: Re: memory usage

Collapse
3: Re: memory usage (response to 1)
Posted by Daniël Mantione on
TCL enables a fast, but wastefull memory allocator if you enable threads. Disable this, it ain't easy, you need to hack the makefiles to do this, and memory usage will drop a lot (on my server (after 24 hours of operation) from +/- 200 mb to +/- 80 mb). Depending on how much visitors your server must serve at the same time, this might or might not be a good idea.

I have also configured my AOLserver to automatically shutdown itself at 04:00 at night to reclaim some memory.

Another thing to consider is the threads. AOLserver tends to start threads when needed and kills them when they are idle. This is does a lot with the heap and should not happen too often, my server uses a fixed amount of 8 threads. If those threads are unneeded, so be it. If this is not enough so the users wait on each other, so be it.

Collapse
4: Re: Re: memory usage (response to 3)
Posted by Malte Sussdorff on
How did you disable the memory allocator? What are the side effects?
Collapse
5: Re: Re: Re: memory usage (response to 4)
Posted by Daniël Mantione on
The configure script sets a define to enable the thread memory allocator if you enable threads. I disabled it by hacking the configure script:

# USE_THREAD_ALLOC tells us to try the special thread-based
# allocator that significantly reduces lock contention
# AC_DEFINE(USE_THREAD_ALLOC)

(There is now a # in front.)

If you do this TCL will use its normal memory manager, which is completely thread safe. I notice no performance difference, allthough my site has rather low traffic. It saves a lot of memory.