You could always overload the "new" operator and keep a log about how much memory was allocated.
Not all memory is allocated using the new operator (and you'd have to do that for every class you use (templates might help)). It's better to redefine malloc() - it'll cover more cases. It won't be 100% foul proof though.
Bookmarks