Originally posted by: Phil Beck
I have three applications running on an NT4 machine. They share several dlls that were written in house.
If I run any of them under the MSVC++ 5 debugger, then I get no reported memory leaks. However, all three applications appear to slowly increase in the amount of memory they use. The only thing that tells me this is the memory column in the processes page of task manager.
If I then shut one of the apps down, the other two apps suddenly drop down to their original memory usage.
I am quite experienced in using the C Runtime debug heap and _CrtSetAllocHook().
I'm not too sure where the MFC version in MSVC++5 stands on its abililty to dump memory leaks.
Thanks
Phil.
Originally posted by: pat
Hello,
I tried setting _CrtSetBreakAlloc() giving it the number in the curly brackets I get in the debug window.
I run my app in debug-mode and wanted to access "_crtBreakAlloc" in the Watch-Window, but it was undefined ((CXXX0017: Error:: symbol "_crtBreakAlloc" not found))!
What's my mistake?
Thanks for your help
Pat
If you are linking against the multithreaded runtime dll. Try puting "{,,msvcrtd.dll}_crtBreakAlloc" in your watch window.
ReplyOriginally posted by: PaoloB
This tecnique is only valid for memory leak generated from class with vtable.
So, if you have this:
normal block at 0x048B80C0, 16 bytes long.
Data: < $ > 18 DA 24 01 00 00 00 00 00 00 00 00 00 00 00 00
insert in your application a code for ask
a string and
CString cl = "0124DA18"; // usualy ask like inputbox :-)
char * foo = " ";
char * p;
void * ptr = (void *)strtoul(cl, &p, 16);
debug ptr to see vtable description:
ptr 0x0124da18 const ClassUnDeleted::`vftable'
byr
Originally posted by: Narayanan N
Friends,
Has anyone used the umdhtools from Microsoft for dectecting the memory leaks in Windows XP??
Narayanan
Originally posted by: Jonathan
Reply
Originally posted by: shashi
How to detect memory leaks if some thing like below appears in your debug window after completion of debugging.
Detected memory leaks!
Dumping objects ->
{318} normal block at 0x02077700, 60 bytes long.
Data: <8 > 38 87 0F 10 CD CD CD CD 00 CD CD CD CD CD CD CD
Object dump complete.
The thread 0x124 has exited with code 0 (0x0).
The program 'D:\Tester\Debug\Tester.exe' has exited with code 0 (0x0).
Shashi
Originally posted by: Farooq Mulla
I am stuck with a memory leak where memory leaks occur in steps of 4kb which makes my mem size above 7MB ....
I checked out the dumping objects ---> created after debugging to get the memory leaks which showed up a couple of pointers i hadnt released which i rectified ,but even then it shows memory leak in plex.cpp (which is a part of the VC++) the message reads something like this
plex.cpp (line 31) <memory location> 164 bytes in Normal blocks
(this line appears for large no of times,at different mem locations which amounts to quite a big mem leak 164bytes*n)
wheras the free blocks occupies 0 bytes & dbg blocks occupies 100 bytes
how do i remove this memory attached in normal blocks ..
whats this concept of normal blocks,dbg blocks & free blocks...
could u plz give me a hint to this.
ReplyOriginally posted by: jesvh
If a c run time program (win32 console application) with
How do I skip memory-leak messages of them ?
example:
class AA
~AA() { free(pp); };
.....
_CrtDumpMemoryLeaks();
Hello, all:
several const global c++ class instances (not use MFC) .
_CrtDumpMemoryLeaks only works before program exit. but
global class instance destructors work after that .....
{
char *pp;
.....
}
const AA a-obj;
void main()
{
.....
.....
}
pp will be showed as memory leak .... but it doesn't.
Is there any method to skip it ?
Originally posted by: Nagaraj Rao
In VC++ under debug windows, I can use memory window to see contents of particular memory location. Is there a way to write this data( which is suppose to be in HEX) into a file by specifying address ranges ? Does Visual studio has some options ?
Ex: If I want to write data contents from memory location to 0x1000 to 0x2000, how do do it ?
regards
Nagaraj Rao
Reply
Originally posted by: Abdul Hafeez
Hi friends,
The techniques for tracking memory leaks are excellent, but in a practical software development we can't be sure if all the control paths of execution are free of memory leaks.
I have a suggesion regarding testing of memory leaks. There are software likes BoundsChecker , Verify etc., which are efficient in testing the memory leaks. Once you install softwares they will get integrated with the Visual Studio environment and are easy to test the applications.
Here in we can get the exact details with analysis of all the memory leaks.
Thanks,
Abdul Hafeez