001
13.10.2008, 20:54 Uhr
ao
(Operator)
|
Hi, this is an issue that needs some expertise. If you are a newbie, you better get some help at your place.
First, make sure it actually is a heap overflow and not in some other way corrupted memory. Check the memory consumption in the Task Manager while the program is running. Are you really using up the memory?
If yes, try to find unbalanced malloc/free or new/delete pairs. There are numerous ways to lose memory.
Check for correct usage of delete and delete[].
Check if all dynamically fetched class members are well deleted, in all possible cases (destructor, assignment operator, other methods that replace a memory region). If you re-allocate memory for a pointer member and an old memory region exists, you must first delete it.
If you have derived classes: Are the destructors virtual? If not, base class destructors are not called, and if the base class allocates memory, it will be lost.
I guess you could also run lint on the source code, to detect the memory leak statically. Sorry I'm not the lint expert, but there are others around here who are.
Good luck ao |