0

Possible Duplicate:
how to find memory leak in c++ code/project

I would like to ask what debugger should I install in order to check for memory leaks? I have an .a that contains a .cpp and an .h . I used a lot of pointers and references. Now I would like to test for memory leaks.

I heard about lint. Does this exist? THX

Community
  • 1
  • 1
skywak
  • 137
  • 3
  • 4
  • 10
  • 1
    You mean [memory leaks](http://en.wikipedia.org/wiki/Memory_leak)? Also, here's how I check if something exists: Is there a wikipedia article? Does Google give several relevant results? – R. Martinho Fernandes Jul 14 '11 at 14:11
  • lint is for C. For C++ you can use cppcheck to find some errors: http://en.wikipedia.org/wiki/Cppcheck – ovk Jul 14 '11 at 14:14

2 Answers2

2

You need memory debugging, memory leak detection, and profiling tool like Valgrind.
Debuggers don't usually do that.

Alok Save
  • 202,538
  • 53
  • 430
  • 533
1

It is called Memory leak. You can use valgrind (linux only) for memory leaks and invalid read/write.

You can also use splint, which is static code analysis tool. But it is used to find another class of errors in the code.

Yousf
  • 3,957
  • 3
  • 27
  • 37