Is there a way detect memory leaks without going through the code and look for them? Some technic, or maybe a developer tool?
Thank you.
Is there a way detect memory leaks without going through the code and look for them? Some technic, or maybe a developer tool?
Thank you.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Something I have done is overload new and delete.
Arrange it such that the new new/delete log where they were called from and what they were asked to do.
Examine the logs, look for unpaired calls for example.
Depending on OS, there are other approaches, but that works at the language level.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
so in other words to track on a code level the allocating ?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Here is a link to a garbage collection library for C and C++. I'm not sure how well it works though since I've never tried it.
i'm not looking to replace the functions but to track them without too much trouble
There are also API function with handles and objects that should also be closed or freed...
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
You can also wrap API functions in logging wrappers if you need to.
Memory leaks are usually either bad design work, or poor implementation of a good design. Whenever I have been asked to find a stubborn memory leak, it has almost always been sloppy coding, not anything esoteric or weird.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Well, i'm talking about slappy coding... because we are all human after all
Can you please explain alittle more about the logging wrapers, and how do I do it?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.