WCF memory usage

I have a WCF service hosting in IIS using net.tcp binding and configured to create PerCall. For testing purposes, I have a single operation that does absolutely nothing.

Each time a client connects and invokes an operation, memory usage increases for the w3wp.exe process, and after the client closes the connection, memory usage does not decrease. After repeated calls, memory increased from the initial 20 MB to 500 MB or more.

Is this normal behavior?

+3
source share
1 answer

When you call the service in the context mode of the PerCall instance, then the memory should be freed after the method returns. Since this does not happen in your scenario, try implementing the IDisposable interface in your services so that you can explicitly control the removal of your services. Also make sure that you close your proxy connections on the client immediately after use.

+2
source

All Articles