[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: programming tools

I don't think electric fence detects memory leaks. I think What it actually does is detect when you're misusing heap-allocated memory.

Here's its writeup from synaptic:

A malloc(3) debugger
Electric Fence is a debugger that uses virtual memory hardware to detect
illegal memory accesses. It can detect two common programming bugs: software
that overruns or underruns the boundaries of a malloc() memory allocation,
and software that touches a memory allocation that has been released by

Unlike other malloc() debuggers, Electric Fence will detect read accesses as
well as writes, and it will stop and pinpoint the exact instruction that
causes an error. It is not as thorough as Purify, however.

In order to debug a program it needs to be linked with Electric Fence's
library or dynamic linking needs to be used; README.Debian explains that in

Jon Dowland wrote:
Joris Huizer wrote:

I'm wondering, is there a tool (under linux) to find memory leaks?

electric-fence is pretty simple to use but very useful. I'd go as far as to recommend that all C/C++ programs that you write should link against it during development.

Christian Convey
Computer Scientist,
Naval Undersea Warfare Center
Newport, RI

Reply to: