currently I am trying to hunt down a memory leak in our software. Using ps I found that the software leaks about 152kB in 15 hours. There is plenty of source code involved so “manually” looking for the leak would be very time consuming.
I use a set of custom alternate functions for memory allocation that allows me to detect memory leak, buffer overrun and underrun, etc. You would have to rename all your fonction call though.
Tell me if you are interested, I can post it here.
If you look on the web you will find plenty of sources that does just that.
thanx for your quick reply (and your offer). Running further tests today, I am tempted to think that the leak is in one of the SQL database calls. Reading that code - to my surprise - there are no “mallocs” nor “frees” in there. So I guess I’ll start there, dig a little deeper and optimize the code a bit. It looks like I can do without additional debug code…
Just found the leak: Back then the programmer used the function strdup() instead of strcpy() in 1 (!) place and never freed the implicitly mallocated memory. Now that I changed the function to strcpy() the memory hogging is all gone