0

I am developing a Visual Studio 2008 plugin DLL which runs in a larger application. I can build it in debug, attach to process, and step through my code. Main problem I have right now is memory leak detection.

Normally I use VLD, but that only seems to give me output when I launch an executable from Visual Studio. VLD isn't giving me any output via attach to process, even after terminating the main program hosting my plugin.

I could build my own test container, however that will take some time and it still won't cover a large portion of the functionality.

Is there a simple way to do memory leak detection via attach to process?

I have tried _CrtDumpMemoryLeaks(), however it isn't working, it isn't detecting a simple line like

int * memoryleak = new int[5000000];

which it normally detects when running directly from within Visual Studio

Any help appreciated, thanks!

1 Answers1

0

You can use umdh utility to find out memory leak in your dll. UMDH is included in Debugging Tools for Windows. For more details check out the following link- https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/using-umdh-to-find-a-user-mode-memory-leak

In case you would like to use a memory leak tool which is having an easy to use GUI for setting up memory leak detection as well as leak reporting then you may go for C++ Memory Validator tool from Software Verify. Although its a paid tool however you can check out its trial version to evaluate it.

Amit Rastogi
  • 926
  • 2
  • 12
  • 22