|
Leak Detection in Visual Studio 2008/10 |
Neil Walker
Member #210
April 2000
|
Hello, and it works a treat, if anyone's interested. You just stick the include file at the top of your source code, ensure the path can find the library and it does the rest on running the program, outputting to the output and a file. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
TeaRDoWN
Member #8,518
April 2007
|
Nice, I will give it a try. Thanks! |
Trent Gamblin
Member #261
April 2000
|
Unfortunately (correct me if I'm wrong) these types of leak detectors only detect leaks in your own code, meaning if you do "bitmap = al_load_bitmap("huge.png"); exit(0);" it won't detect it. And for me that's where most of my leaks happen. I've been playing around with MemoryValidator for a while now. I tried it a year or 2 ago and it was awesome except for lack of symbolicating mingw code. Now I can't seem to get it to symbolicate even MSVC code properly, which is a shame. It does find leaks that nothing else I've tried finds though, and through some telepathic thinking I was able to deduce where the main leaks were coming from without the symbols. If I could get this thing symbolicating my MinGW code, it would be work the $299. It detects memory errors as well as some other things too.
|
TeaRDoWN
Member #8,518
April 2007
|
Shame, however better than nothing I guess. Previous project I made my own memory tracker that made sure that all allocations were deallocated. Had the wierdest crash/hang there and it was due to a malloc that never got free'd. |
Arthur Kalliokoski
Second in Command
February 2005
|
Trent Gamblin said: And for me that's where most of my leaks happen. What OS doesn't release memory when a program exits? And it seems to me it'd only be the work of a couple hours to make a wrapper for new or malloc() that'd track memory allocations with a function to list current memory usage, which line of code allocated it, how long it was in existence and you could stick in an atexit() to do it upon exit(0). [EDIT] I wrote the above before Teardown edited the previous post, and no, I didn't check his revision history to deduce this . They all watch too much MSNBC... they get ideas. |
Trent Gamblin
Member #261
April 2000
|
That was an example. I thought it was clear that I meant memory allocated by external libraries isn't tracked by these types of leak detectors (and there are a lot of them). And no, it's not difficult to write one like the one in the OP.
|
kenmasters1976
Member #8,794
July 2007
|
Neil Walker said: You just stick the include file at the top of your source code, ensure the path can find the library and it does the rest on running the program, outputting to the output and a file. I use memwatch on gcc with MinGW. It works pretty much in the same way although, as Trent Gamblin said, it only detects leaks on your own code. It may not be very robust but it is more than enough for the projects I code and it's proven useful to me.
|
gnolam
Member #2,030
March 2002
|
-- |
TeaRDoWN
Member #8,518
April 2007
|
gnolam: Have used that one before, helped me in some places. The two are fairly similar but the one in the first post seem to have a callstack showing you where in the code where each memory partition was allocated. EDIT: Got this after installing the "VLD": Does it not work together with Allegro or is there a way to fix this? |
SiegeLord
Member #7,827
October 2006
|
TeaRDoWN said: Does it not work together with Allegro or is there a way to fix this? allegro.cc comes with a nice search feature. This question has been asked and answered tens, if not hundreds of times before. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Edgar Reynaldo
Major Reynaldo
May 2007
|
#include <allegro.h> #include <winalleg.h> #include <other_windows_headers_here.h> BITMAP* bmp = 0; int main(int argc , char** argv) {return 0;}END_OF_MAIN()
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|