Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to detect GDI leaks from the Visual Studio debugger?

Tags:

Leaking GDI objects can be seen from the task manager or from Process Explorer. (Well you don't see the leaks, but you can see if object uasage count continually goes up.)

There are also tools that allow to view GDI objects by type, such as GDIView[a], DeLeaker, DPUS or the GDIDebug (sourecode).

[a] Note that I consider GDIView a great tool to get the job done of identifying and confirming the existance GDI leaks, but it doesn't really help you to find the leaking code in large applications. (I will also note here that the tool works very nicely and seems well behaved, although its homepage is a littlebit weird (-: )

There is also a WinDBG plugin called leaktrap that uses MSs Detours Library.

I also know (and have used) AQTime's Resource Profiler that allows to detect GDI (and other) resource leaks in an application including stack traces for the leaking calls.

Now, my actual question however is: Is it possible to detect leaking GDI objects from within the VC++ debugger? So that one doesn't need a separate tool and GDI leaks can be caught during normal debugging and not have to be checked separately.

like image 884
Martin Ba Avatar asked Dec 01 '10 09:12

Martin Ba


People also ask

How do I find a GDI leak?

Leaking GDI objects can be seen from the task manager or from Process Explorer. (Well you don't see the leaks, but you can see if object uasage count continually goes up.) There are also tools that allow to view GDI objects by type, such as GDIView[a], DeLeaker, DPUS or the GDIDebug (sourecode).

How do I detect memory leaks in Visual Studio?

To find memory leaks and inefficient memory usage, you can use tools such as the debugger-integrated Memory Usage diagnostic tool or tools in the Performance Profiler such as the . NET Object Allocation tool and the post-mortem Memory Usage tool.

How detect memory leaks C++?

The primary tools for detecting memory leaks are the C/C++ debugger and the C Run-time Library (CRT) debug heap functions. The #define statement maps a base version of the CRT heap functions to the corresponding debug version. If you leave out the #define statement, the memory leak dump will be less detailed.


1 Answers

GDI objects do not have to be checked individually (notreally), they can be in charge with Deleaker - and you'll know where the leak. Read the instructions carefully and view a demo video :http://deleaker.com/

like image 114
MastAvalons Avatar answered Sep 18 '22 01:09

MastAvalons