5

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.

KindDragon
  • 6,558
  • 4
  • 47
  • 75
cyber_raj
  • 1,780
  • 1
  • 14
  • 25

1 Answers1

3
  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.
Markus Schumann
  • 7,636
  • 1
  • 21
  • 27
  • Unfortunately i m not getting VLD Output in debug window after stopping the service. The Output window shows its usual output: The program 'xyz.exe: Native' has exited with code 0 (0x0). – cyber_raj Jun 07 '13 at 06:54
  • What u have written i m supposed to accept your answer as i solved it by including vld.h at a different place. – cyber_raj Jun 07 '13 at 08:27