Profiling windows service

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Radaska
Posts: 2
Joined: Thu Jun 15, 2006 7:20 pm

Profiling windows service

Post by Radaska » Thu Jun 15, 2006 7:41 pm

Hi,

I am trying to profile a windows service that is hosted together with another service in one process. The situation:

Process X contains service A and B (in one AppDomain). Service B is dependent on service A. Both services are hosted in one process to prevent .NET remoting overhead and to improve performance.

Profiling service A goes without problem. When I try to profile service B, I see that service B and A are both started by .NET Memory Profiler, but the message 'Waiting for Service to start' never finishes. I can only press the cancel button, so I am not able to profile service B.

Is this currently supported in .NET Memory Profiler 2.6 or 3.0 Preview?
Is there a workaround or will .NET Memory Profiler support this in the future?

Many thanks,
Rad

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Post by Andreas Suurkuusk » Fri Jun 16, 2006 9:15 am

The profiler is only able to connect to a newly started process, not an AppDomain. If you have two services that run in the same process, you cannot profile each service by itself. To profile both services, you can perform the following:
  1. Stop both services manually (e.g. using "Services" under Administrative Tools)
  2. In the profiler select one of the services and start the profiler.
  3. Manually start the second service.
Now you are profiling both services within one profiling session. Unfortunately, you will not be able to identify which service the instances belong to. We're planning on adding support for AppDomain filtering in .NET Memory Profiler 3.0 (or possibly v3.1), which will allow you to view heap information for a specific service (as long as they run in separate AppDomains).
Best regards,

Andreas Suurkuusk
SciTech Software AB

Radaska
Posts: 2
Joined: Thu Jun 15, 2006 7:20 pm

Post by Radaska » Fri Jun 16, 2006 4:39 pm

Thanks a lot! Manually starting the second service worked perfectly, I was able to profile both services.
Fortunately the stacktraces pointed me to the service that caused the memory leak.

I really love .NET Memory Profiler!

Best regards,
Rad

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests