Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,
Other than rational purifier, is their any (free or fully evaluating) tool to analyze memory leaks in my win32 native service?
Posted

All good answers above...

If you can run your service in the debugger in _DEBUG mode, simply put the following define in each of your .cpp files after the #include statements.

C++
#ifdef _DEBUG
#define new DEBUG_NEW
#endif


Then the debugger will list all of your leaks on exit, and give you the location where the memory was allocated.
 
Share this answer
 
Comments
JackDingler 5-Dec-11 14:31pm    
Could who ever voted one star for my answer, please explain where I went wrong?

1. This works well 99% of the time.
2. It's built into the debugger which means it's essentially free if you have Visual Studio already.
Bounds Checker is a great tool that I have used - DevPartner for Visual C++ BoundsChecker Suite[^]
 
Share this answer
 
I think Rational Purify is a good option, very useful tool [^]
 
Share this answer
 
Comments
Albert Holguin 5-Dec-11 14:17pm    
You should probably read his post again.
ya, i agree Rational purifier is a great tool for this purpose if you want to find memory leaks in win32 applications, but if i try to do the same with my service, the service is being launched and the purifier will say the application exited with code 0 (Normal exit) i am not able to find leaks run time.
 
Share this answer
 
Comments
Albert Holguin 5-Dec-11 14:18pm    
If you have a "Question or Comment" in regards to someone's specific solution, respond using the link below their solution. Don't post follow-ups as a solution.
Debugging Tools for Windows[^] should include a tool call LeakDiag. I would try that first.
 
Share this answer
 
You can use Deleaker - powerful analyze memory leaks and not only for this.
 
Share this answer
 
Comments
SuperMegaCoder 14-Mar-12 12:38pm    
I also use ti for debugging memory leaks - good tool)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900