[SGVLUG] Help Treating Memory Leak
Claude Felizardo
cafelizardo at gmail.com
Thu Mar 9 10:54:35 PST 2006
On 3/9/06, Alex Roston <tungtung at pacbell.net> wrote:
> I'm currently writing an application which appears to have a nasty
> memory leak. If I run it for an hour or two it will happly increase the
> memory used by 10-20 megabytes, at least as "top" measures things. Can
> anyone suggest a program which will accurately track memory use by a
> single application as it's running? "Top" shows me the memory the system
> is using, and the memory the program SHOULD BE using, but it's not
> giving me a definitive answer about what my application is doing with
> memory, or whether the problem is some other part of the system, or
> perhaps me test program...
>
> Thanks,
>
> Alex
You don't say what language so I'm just going to assume C/C++.
We had the same problem, top shows memory growth over several hours.
We use Insure++ from Parasoft. Don't know if they support Linux but
I've been using it on Solaris for the last few days. We use it to
track down memory leaks, uninitialized memory reads and writes, etc.
It is a commercial product but you definitely get what you pay for.
Insure works by instrumenting as many of your source modules as you
specify. For standard C library calls, it inserts calls to its
libraries so it can check your function arguments, if you don't use
memory returned, etc. This allows it to identify problems at both
compile time and run time.
On a previous project, we used another commercial product which I
can't recall. Sorry.
A quick google search using "C++ memory checker" shows this:
Comparison of Free Memory Checkers
http://www.cs.utexas.edu/~jpmartin/memCheckers.html
More information about the SGVLUG
mailing list