cyber_raj
cyber_raj

Reputation: 1857

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.

Upvotes: 5

Views: 1659

Answers (1)

Markus Schumann
Markus Schumann

Reputation: 8264

  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.

Upvotes: 3

Related Questions