Forum OpenACS Q&A: Re: Tracking Memory Usage

Collapse
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 openacs.org [1], which runs aolserver, with the size from next-scripting.org [2] which runs naviserver. If the traffic on your site is similar to openacs.org and you run a similar configuration, then the memory growth rate should be as well comparable to openacs.org.

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

-gustaf

[1] https://openacs.org/munin/localdomain/localhost.localdomain/naviserver_openacs_memsize.html
[2] http://alice.wu-wien.ac.at:8000/munin/wu.ac.at/alice.wu.ac.at/naviserver_next_memsize.html
[3] https://next-scripting.org/xowiki/docs/misc/thread-mallocs/index1