Memory Leak Debugging ( and COM ) 
Author Message
 Memory Leak Debugging ( and COM )

I've been using the _CrtDumpMemoryLeaks() and _CrtMemCheckpoint functions to
try and isolate some elusive memory leaks in a multi-process COM/ATL
project.  This doesn't work so well for a few reasons, maybe someone can
help me out and explain why??

1.  even though I have the following in my stdafx.h:
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
I still do not get the filename and line number for my memory dumps....

2.  I am unable to set breakpoints on allocation order numbers.  I've tried
manually setting them using
the Watch window and _crtBreakAlloc and also programmatically with
_CrtSetBreakAlloc( ) but they are just ignored?? ( I have stepped into an
out-of-process COM object when this happens)

3.  In some components even my _CrtDumpMemoryLeaks( ) calls are ignored...?

I __really__ need to solve this problem...and soon!!! Anyone with debugging
expertise in this area please throw me a bone!!!  Thank you,

Colin Reinhardt



Fri, 08 Nov 2002 03:00:00 GMT  
 Memory Leak Debugging ( and COM )
Hi Colin,

I do the following for the first item:

#define _CRTDBG_MAP_ALLOC       // Enable memory debugging (before including
crtdbg.h)
#include <crtdbg.h>                                // Run-time debugging
support (e.g. assertions)

// redefine global new (crtdbg.h gets filename/line no. wrong because it
inlines rather than #define-ing)
#define new     new(_NORMAL_BLOCK, __FILE__ , __LINE__)

This will pick up a few more of the right file/line numbers.

Gary


Quote:
> I've been using the _CrtDumpMemoryLeaks() and _CrtMemCheckpoint functions
to
> try and isolate some elusive memory leaks in a multi-process COM/ATL
> project.  This doesn't work so well for a few reasons, maybe someone can
> help me out and explain why??

> 1.  even though I have the following in my stdafx.h:
> #define _CRTDBG_MAP_ALLOC
> #include <stdlib.h>
> #include <crtdbg.h>
> I still do not get the filename and line number for my memory dumps....
> Colin Reinhardt



Thu, 14 Nov 2002 03:00:00 GMT  
 Memory Leak Debugging ( and COM )
Work for a company called Compuware Corporation which specializes in
application software development, testing and management tools.  In
particular we have tools that focus to a specific line of code, give an
explanation, and suggest a fix.  If interested in learning more, please call
972-577-0293, and visit our website at www.compuware.com.


Quote:
> I've been using the _CrtDumpMemoryLeaks() and _CrtMemCheckpoint functions
to
> try and isolate some elusive memory leaks in a multi-process COM/ATL
> project.  This doesn't work so well for a few reasons, maybe someone can
> help me out and explain why??

> 1.  even though I have the following in my stdafx.h:
> #define _CRTDBG_MAP_ALLOC
> #include <stdlib.h>
> #include <crtdbg.h>
> I still do not get the filename and line number for my memory dumps....

> 2.  I am unable to set breakpoints on allocation order numbers.  I've
tried
> manually setting them using
> the Watch window and _crtBreakAlloc and also programmatically with
> _CrtSetBreakAlloc( ) but they are just ignored?? ( I have stepped into an
> out-of-process COM object when this happens)

> 3.  In some components even my _CrtDumpMemoryLeaks( ) calls are
ignored...?

> I __really__ need to solve this problem...and soon!!! Anyone with
debugging
> expertise in this area please throw me a bone!!!  Thank you,

> Colin Reinhardt



Sun, 08 Dec 2002 03:00:00 GMT  
 Memory Leak Debugging ( and COM )
Anybody know what product from Compuware he is referring to?  I tried
looking at the web site and it was not obvious to me.  Looked more
like mainframe tools -- I was looking for something aimed at C and
C++.



Quote:
>Work for a company called Compuware Corporation which specializes in
>application software development, testing and management tools.  In
>particular we have tools that focus to a specific line of code, give an
>explanation, and suggest a fix.  If interested in learning more, please call
>972-577-0293, and visit our website at www.compuware.com.



>> I've been using the _CrtDumpMemoryLeaks() and _CrtMemCheckpoint functions
>to
>> try and isolate some elusive memory leaks in a multi-process COM/ATL
>> project.  This doesn't work so well for a few reasons, maybe someone can
>> help me out and explain why??

>> 1.  even though I have the following in my stdafx.h:
>> #define _CRTDBG_MAP_ALLOC
>> #include <stdlib.h>
>> #include <crtdbg.h>
>> I still do not get the filename and line number for my memory dumps....

>> 2.  I am unable to set breakpoints on allocation order numbers.  I've
>tried
>> manually setting them using
>> the Watch window and _crtBreakAlloc and also programmatically with
>> _CrtSetBreakAlloc( ) but they are just ignored?? ( I have stepped into an
>> out-of-process COM object when this happens)

>> 3.  In some components even my _CrtDumpMemoryLeaks( ) calls are
>ignored...?

>> I __really__ need to solve this problem...and soon!!! Anyone with
>debugging
>> expertise in this area please throw me a bone!!!  Thank you,

>> Colin Reinhardt



Wed, 18 Dec 2002 03:00:00 GMT  
 Memory Leak Debugging ( and COM )

BoundsChecker


Quote:
> Anybody know what product from Compuware he is referring to?  I tried
> looking at the web site and it was not obvious to me.  Looked more
> like mainframe tools -- I was looking for something aimed at C and
> C++.



> >Work for a company called Compuware Corporation which specializes in
> >application software development, testing and management tools.  In
> >particular we have tools that focus to a specific line of code, give an
> >explanation, and suggest a fix.  If interested in learning more, please
call
> >972-577-0293, and visit our website at www.compuware.com.



> >> I've been using the _CrtDumpMemoryLeaks() and _CrtMemCheckpoint
functions
> >to
> >> try and isolate some elusive memory leaks in a multi-process COM/ATL
> >> project.  This doesn't work so well for a few reasons, maybe someone
can
> >> help me out and explain why??

> >> 1.  even though I have the following in my stdafx.h:
> >> #define _CRTDBG_MAP_ALLOC
> >> #include <stdlib.h>
> >> #include <crtdbg.h>
> >> I still do not get the filename and line number for my memory dumps....

> >> 2.  I am unable to set breakpoints on allocation order numbers.  I've
> >tried
> >> manually setting them using
> >> the Watch window and _crtBreakAlloc and also programmatically with
> >> _CrtSetBreakAlloc( ) but they are just ignored?? ( I have stepped into
an
> >> out-of-process COM object when this happens)

> >> 3.  In some components even my _CrtDumpMemoryLeaks( ) calls are
> >ignored...?

> >> I __really__ need to solve this problem...and soon!!! Anyone with
> >debugging
> >> expertise in this area please throw me a bone!!!  Thank you,

> >> Colin Reinhardt



Sun, 29 Dec 2002 03:00:00 GMT  
 Memory Leak Debugging ( and COM )
what kind of memory leak?
you won't find COM memory leaks this way, try instead IMAllocSpy

Christian

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 04 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Tracking memory leaks and debugging memory problems

2. memory leak - com interop

3. Debug memory leaks

4. MSXML raw com interfaces and memory leaks...

5. COM Release problem and Memory Leak

6. How to detect memory leaks in an ATL COM server with MFC

7. Memory leaks in VC++ COM object

8. Memory leak from COM

9. Purify .vs. Boundschecker for COM/BSTR memory leaks

10. ATL COM memory leak?

11. Detect memory leak in ATL COM

12. Memory leak from COM

 

 
Powered by phpBB® Forum Software