Request for help

Christian Couder chcouder at club-internet.fr
Mon Sep 4 19:24:02 BST 2000


Benjamin Meyer wrote :
> 
> I am the main author of the application Kaim.
> http://www.csh.rit.edu/~benjamin/benjamin/works/kaim/  I know that there
> is a memory leak somwhere in my application, but have been unable to
> find it.  I was unable to get both linkChecker and mpr to work.  If
> anyone out there would care to lend me a little time to help me on this
> that would be really cool.  Thanks.

Hi,

In my opinion it should not be very hard to find out where it is.
The problem is to find the class where it happens.
To do that I think you should do the following :

_ Remove all the calls to malloc, calloc, free and so on if possible. If
not put all the malloc in a class constructor and put a corresponding
free in the class destructor.
_ Add something like printf("%d classname created\n", this) to each
constructor of any of your class where "classname" is the name of the
class.
_ Add something like printf("%d classname deleted\n", this) to each
destructor of any of your class where "classname" is the name of the
class.
_ Run your program a little and save the output to a file.
_ Sort the lines of the output file and check that for each class there
is the same number of constructed and destroyed objects.

Bye,
Christian




More information about the KDevelop mailing list