Forum OpenACS Q&A: Re: Tracking Memory Usage

4: Re: Tracking Memory Usage (response to 1)
Posted by Gustaf Neumann on
The list of potential leaks is quite long and depends on many factors. if possible, tell us more about the site.

several things to check:
- use a recent version of tcl 8.5
- are you running a 32bit or 64bit binary?
- do you make daily restarts?
- what tcl extensions are you using in which version?
- what openacs packages are you using?
- what is the rss and vmsize of nsd after startup and after one hour?
- what is the maxconnections in your aolserver configuration?
- have you set some especially large configuration values?

domNodes are a classical memleak, but one can as easy leak in namespaced variables, since these are not reclaimed at the end of a requests.

tcl is optimized for speed and not for memory space. try to avoid cases, where you read e.g. huge files into tcl vars and append to it. If the allocated memory is not sufficient (e.g. by one byte), tcl will realloc the memory with the double size.

aolserver has a few small memory leaks, naviserver is better in this regard. Compare the memory growth of [1], which runs aolserver, with the size from [2] which runs naviserver. If the traffic on your site is similar to and you run a similar configuration, then the memory growth rate should be as well comparable to

One can do a lot with different memory allocators, but i am not sure this is necessary.