12-May-2013

Memory leak?
In time, usage of virtual memory increases from less than 25% to about 60. All in all, it took 140 days so it’s not that dramatic. Nevertheless, it’s something that should not occur; it means that some process in the system requires more and more memory and doesn’t return it. This might be legitimate, but it could also reveal an error. It must be a process that is continuously running, and that rules out PHP, because these run idle for a very limited time. I can also rule out VMS itself, because that has been tested on this amount of memory leakes. Leaves the webserver itself, MySQL and the spam filter.
WASD is unlikely, I know it’s memory requirements are limited, memory is allocated once (on start of the server) and all worker processes on my system run as long as there is something to do – and they disappear when idle for some time, so allocated memory is returned automatically (that’s the way VMS is built 🙂 ).
MySQL could be a cause; it keeps record of changes and caches results. So I stopped and restarted the MySQL server, memory usage dropped somewhat but just about 5%.
Next culprit is the mail filter, and indeed, stopping and starting these processes caused the memory use to drop below 25:

after this action was completed.
There is something to look into.
I have observed that the increment of memory usage occurs in steps, that coincide with high CPU requirements, a increment of number of processes, and, by that, increased paging (in fact: usage of real memory drops dramatically, at the same time, usage of the page file increases. This means that modified pages are written to disk….). If this coincides with the heavy mail usage found in the logs (operator, PMAS and router) this means there is something for Process to look into. Such an event may start a lot of worker processes, that exit when idle for some time. Memory should be returned in that case, but it looks as if memory, once allocated, is kept allocated. It might be legitimate, since the memory recommendation for PMAS is 1 Gb minimal and Diana has only half of that. But if this coincidence exists, it may be worthwhile to note this to Process. Better be sure….

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.