[CLUE-Tech] C programming question

Michael J. Hammel mjhammel at graphics-muse.org
Wed Dec 12 09:41:51 MST 2001


Thus spoke Jim Ockers
> Our programmer says that he has been able to find memory leaks in the
> past using GUI tools such as MS Visual Studio for Windows programs.  He has
> not been able to find an efficient tool for doing the same sort of searches for
> memory leaks in programs on Linux systems.

There are a number of tools for checking memory on Linux systems.  The best
route are the commercial tools such as Purify or Sentinal, but I don't know
which of these has been ported to Linux (I think they both have, but don't
have proof of that).  

I used Electric Fence recently and it seemed to be fairly useful.  Nothing
like the commercial tools, but it was easier to use (just link with the
efence library).  However, it mainly checks memory overrun usage for you.
Not sure if it can catch memory leaks or not.

The man page for Electric Fence is "efence".  Usage is like this:

export EF_PROTECT_FREE=1; \
export LD_PRELOAD=libefence.so.0.0;\
exec prog

It replaces the systems mallocs, etc with its own versions.
-- 
Michael J. Hammel           |
The Graphics Muse           |   If love is blind, why is lingerie so popular?
mjhammel at graphics-muse.org  |
http://www.graphics-muse.com 



More information about the clue-tech mailing list