开发者

ServiceHost Efficiency

Hoping you could help me pl开发者_开发问答ease..

I am using WCF in my program. Part of this includes using ServiceHost in a self-service type scenario using a netNamedTypeBinding. When I include ServiceHost in my class and then instantiate that class (ServiceHost is set to null at this point), the memory usage increases by approx 9Mb. If I comment out the ServiceHost attribute the memory doesnt jump.

This is a fair old chunk of memory being used by ServiceHost. Is there anyway to cut this down or is there a version of ServiceHost that is leaner? Asking out of desperation really as I need to my my program as memory efficient as possible.

Many thanks for your time


Direct answer: No probably not. You are pulling in a sizable library and you'll just have to pay the price.

But a couple of points:

  • on any platform that can run WCF at all, 9MB shouldn't be a lot.
  • measuring memory use under a modern OS is complicated. What memory value (there are many) are you using for this?
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜