detecting memory leaks in vc7 
Author Message
 detecting memory leaks in vc7

Hi,

In VC6 in debug mode at the end of the program if there are any memory
leaks, they are reported with an associated allocation number {Object
dump}. In a debug mode execution we can stop the execution at the
specified memory allocation by allocating allocation number to

{,,msvcrtd.dll}_crtBreakAlloc

but this doesnt seem to be working in VC7 (VC++ .NET ).

Watch window complains
CXX0036:Error:bad Context {...} specification

I am trying to debug a unicode multithreaded application.
What am i missing ?

Any pointers to web articles where i could get more info on detecting
memory leaks in vc7 ??

Thanx and Regards,
Vijay Chegu
//vijaychegumemoryleak



Mon, 03 Jan 2005 00:56:50 GMT  
 detecting memory leaks in vc7
VC7 has new C runtime. Try this:

{,,msvcr70d.dll}_crtBreakAlloc



Mon, 03 Jan 2005 01:44:24 GMT  
 detecting memory leaks in vc7
Hi Nobody,

Thanx man it worked :)

Regards,
Vijay Chegu

Quote:

> VC7 has new C runtime. Try this:

> {,,msvcr70d.dll}_crtBreakAlloc



Mon, 03 Jan 2005 12:44:43 GMT  
 detecting memory leaks in vc7
{,,msvcr70d.dll}_crtBreakAlloc does not work when compiling a DLL with /MTd
only with /MDd, any idea what will work with /MTd?

Thanks

Gregor


Quote:
> Hi Nobody,

> Thanx man it worked :)

> Regards,
> Vijay Chegu




Quote:
> > VC7 has new C runtime. Try this:

> > {,,msvcr70d.dll}_crtBreakAlloc



Sat, 08 Jan 2005 23:54:53 GMT  
 detecting memory leaks in vc7

Quote:
>{,,msvcr70d.dll}_crtBreakAlloc does not work when compiling a DLL with /MTd
>only with /MDd, any idea what will work with /MTd?

use your dll name instead of msvcr70d.dll.
Please note that when you use the static version of crt (/MTd or /MLd)
there are multiple copies CRT libs and hence CRT heaps and _crtBreakAlloc
variables involved. For example lets say  you have a dll (say mydll.dll )
and exe  (say myexe.exe) both built with /MTd.
Both mydll and myexe will have its own unique copy of CRT and debug heaps.
Allocated memory in dll cannot be deallocated from exe or vice-versa.

Hope this helps

Thank you,
Bobby Mattappally
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.



Sun, 09 Jan 2005 09:23:22 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Memory Leak detection in VC7

2. VC7++ - Detection of memory leaks, mixed DLL (unmanaged/managed)

3. Memory leak? (std::map, VC7)

4. Detecting memory leaks

5. HELP:Detecting memory leaks

6. How to detect memory leak in Linux?

7. Detecting memory leaks

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

9. How to detect Memory Leaks ?

10. Detecting Memory Leaks efficiently

11. Detecting a memory leak in a component

12. How to detect memory leaks in ATL

 

 
Powered by phpBB® Forum Software