Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / programming / debugging

Fast and easy memory leak detection

2.67/5 (3 votes)
26 Jan 2012CPOL 16.4K  
For Visual Studio IDE we can detect leaks by using CRT debugger functions#define _CRTDBG_MAP_ALLOC#include #include void main(){ // ...... // ...... _CrtDumpMemoryLeaks();}This will dump leaks if any to the Output window. Check this link :...
For Visual Studio IDE we can detect leaks by using CRT debugger functions

C++
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

void main()
{
   // ...... 
  // ......

  _CrtDumpMemoryLeaks();
}</crtdbg.h></stdlib.h>


This will dump leaks if any to the Output window. Check this link : http://msdn.microsoft.com/en-us/library/e5ewb1h3(v=vs.80).aspx[^]

Any way this seems to a nice tool. I will try it for sure. My 5

License

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