2

I've got a windows service written in C#, that does some heavy work (irrelevant for the question) running on a remote machine (Windows Server 2008).

Every now an then a client application contacts the service. The service starts its work and possibly consumes large bunch of memory. It releases the consumed memory after the work is done. Everything fine so far, no memory leaks or the like. But unfortunately the service allocates almost all memory available if multiple clients contact it (which is basically ok, since it does hard work). The drawback is that then there's no memory available for other services that run on that machine.

So is there a way to limit or constrain the amount of memory my service may allocate? Is it somehow possible to declare, say, take up to 50% of the machine's memory but not more? Something like this is possible for processes hosted in IIS, but mine is a 'ususal' windows service.

0 Answers0