Using MemoryLeak detection in MFC
-
Hi, When i search over the google about Memory leaks.I came to know about this commands.Then i use it in my code.
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtMemState s1, s2, s3;
_CrtMemDumpStatistics( &s1 );After closing my application i found this in output window But i cannot understand whats it saying. Pls help me whether this is a serious concern i have to look out. In Output window i got this
2439008 bytes in 2147348480 Free Blocks.
1244712 bytes in 2438992 Normal Blocks.
2089871648 bytes in -16711681 CRT Blocks.
2089919440 bytes in 2010977956 Ignore Blocks.
-1 bytes in 1244308 Client Blocks.
Largest number used: 2089919435 bytes.
Total allocations: 2089918906 bytes.Anu
-
Hi, When i search over the google about Memory leaks.I came to know about this commands.Then i use it in my code.
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtMemState s1, s2, s3;
_CrtMemDumpStatistics( &s1 );After closing my application i found this in output window But i cannot understand whats it saying. Pls help me whether this is a serious concern i have to look out. In Output window i got this
2439008 bytes in 2147348480 Free Blocks.
1244712 bytes in 2438992 Normal Blocks.
2089871648 bytes in -16711681 CRT Blocks.
2089919440 bytes in 2010977956 Ignore Blocks.
-1 bytes in 1244308 Client Blocks.
Largest number used: 2089919435 bytes.
Total allocations: 2089918906 bytes.Anu
Why not use the CMemoryState Class to find the memory leak?? It gives you a better understanding.
-
Hi, When i search over the google about Memory leaks.I came to know about this commands.Then i use it in my code.
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtMemState s1, s2, s3;
_CrtMemDumpStatistics( &s1 );After closing my application i found this in output window But i cannot understand whats it saying. Pls help me whether this is a serious concern i have to look out. In Output window i got this
2439008 bytes in 2147348480 Free Blocks.
1244712 bytes in 2438992 Normal Blocks.
2089871648 bytes in -16711681 CRT Blocks.
2089919440 bytes in 2010977956 Ignore Blocks.
-1 bytes in 1244308 Client Blocks.
Largest number used: 2089919435 bytes.
Total allocations: 2089918906 bytes.Anu
Those are the memory dump statistics that you asked for. You really only need the _CrtSetDbgFlag() call in your CWinApp-derived class constructor and it will do the leak detection for you. Also remember to define new as DEBUG_NEW for debug builds in all source modules.
-
Hi, When i search over the google about Memory leaks.I came to know about this commands.Then i use it in my code.
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
_CrtMemState s1, s2, s3;
_CrtMemDumpStatistics( &s1 );After closing my application i found this in output window But i cannot understand whats it saying. Pls help me whether this is a serious concern i have to look out. In Output window i got this
2439008 bytes in 2147348480 Free Blocks.
1244712 bytes in 2438992 Normal Blocks.
2089871648 bytes in -16711681 CRT Blocks.
2089919440 bytes in 2010977956 Ignore Blocks.
-1 bytes in 1244308 Client Blocks.
Largest number used: 2089919435 bytes.
Total allocations: 2089918906 bytes.Anu
I recommend that you use Visual Leak Detector - Enhanced Memory Leak Detection for Visual C++[^] for detecting memory leaks.