memory leak questions

Started by
5 comments, last by Sc4Freak 16 years, 1 month ago
Can anybody suggest an application which i can use much like task manager, but gives the ram readings more accuratly, Im looking to view the byte usage of my game, as i have a memory leak somewhere, and would like to view to a scale of bytes rather than kbytes. thanks
Advertisement
For C/C++, that's not possible (system memory allocation is different from your application's, and the information you want simply does not exist), unless you add such functionality to your application at compile time.
Most compilers come with some sort of functionality to detect memory leaks as part of their runtime library. For example, MSVC has functions in the crtdbg.h header that can help with memory leaks like _CrtDumpMemoryLeaks() and _CrtSetDbgFlag() the latter of which is especially useful with the argument _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF.
Such a thing isn't possible, for the reasons Antheus describes.
Getting a more accurate read would be pointless anyway, as it wont tell you where the leak is.

Note that as a programmer, you should use sysinternal's Process Explorer anyway. It's a replacement for Task Manager which I think no Windows developer should be without.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms
Quote:Original post by iMalc
Note that as a programmer, you should use sysinternal's Process Explorer anyway. It's a replacement for Task Manager which I think no Windows developer should be without.

QFT. Its "Find Handle or DLL" feature has saved me tons of time hunting down programs that still have my files locked after I've closed them (usually a runaway devenv process, sigh). However I hear Bioshock won't run after you use Process Explorer because its copy protection doesn't like it, but I've never tested it that out.
cheers,

i will try it now
Quote:Original post by Zipster
Quote:Original post by iMalc
Note that as a programmer, you should use sysinternal's Process Explorer anyway. It's a replacement for Task Manager which I think no Windows developer should be without.

QFT. Its "Find Handle or DLL" feature has saved me tons of time hunting down programs that still have my files locked after I've closed them (usually a runaway devenv process, sigh). However I hear Bioshock won't run after you use Process Explorer because its copy protection doesn't like it, but I've never tested it that out.

Same with C&C3. It's annoying.
NextWar: The Quest for Earth available now for Windows Phone 7.

This topic is closed to new replies.

Advertisement