I have a very small wcf service hosted in a console application.
[ServiceContract] public interface IService1 { [OperationContract] void DoService(); } [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] public class Service1 : IService1 { public void DoService() { } }
and they call him
using (ServiceReference1.Service1Client client = new ServiceReference1.Service1Client()) { client.DoService(new DoServiceRequest()); client.Close(); }
Please remember that the service is published on basicHttpBindings.
Problem
Now that I have executed the client code above in a 1000 loop, I found a big difference between the performance counters โAll bytesโ and โPrivate bytesโ (I used the .net memory profiler). After the investigation, I found that some of the objects are incorrectly located. Below is a list of these objects (1000 invisible instances were found โ equal to client calls)
(the namespace for all of them is System.ServiceModel.Channels)
HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream BodyWriterMessage BufferedMessage HttpRequestContext.ListenerHttpContext.ListenerContextHttpInput.ListenerContextInputStream HttpRequestContext.ListenerHttpContext
Questions Why do we have many undivided objects and how to control them.
Please, help
Mubashar
source share