WCF memory usage

折月煮酒 提交于 2020-01-01 14:36:02

问题


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

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

Is this normal behavior?


回答1:


When you call a service with PerCall Instance Context mode then the memory should be released after the method returns. Since that is not happening in your scenario, try to implement the IDisposable interface on your services to be able to control the disposal of your services explicitly. Also make sure that you close your proxy connections on the client right after usage.



来源:https://stackoverflow.com/questions/4680289/wcf-memory-usage

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!