Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attaching Visual leak detector to a process running as windows service

How to use Visual Leak Detector to attach to a process running as a windows service. If someone has used this tool to detect memory leaks for service, please let me know the procedure.

I am including "vld.h" in my source file as in the documentation nothing else.

like image 500
cyber_raj Avatar asked Oct 22 '22 09:10

cyber_raj


1 Answers

  1. Compile your service in debug with vld.h included.
  2. Start your service from the Services Control Manager (no debugger involved yet)
  3. Start Visual Studio - in the Debug Menu select attach to process
  4. Select your process (your service) - make sure to enable native debugging
  5. Stop your service with the debugger still attached and you should get output in the debug window.
like image 195
Markus Schumann Avatar answered Oct 25 '22 17:10

Markus Schumann