CPU and Memory Cap for an AppDomain

后端 未结 4 439
逝去的感伤
逝去的感伤 2020-12-18 21:13

I want to host an exe in an appdomain and assign a CPU and Memory cap to it so that it does not use more than the assigned processing power. Is this possible to do and how?<

4条回答
  •  感情败类
    2020-12-18 21:48

    Even the Windows performance monitors don't allow you to view CPU usage by AppDomain - since AppDomains are logical constructs of the CLR and are not known by the OS the only CPU usage tracking is at process level - I would be shocked if there is a way to limit something that you can't even monitor.

    What exactly is your reason for wanting to do this? Why wouldn't you want your application to use all resources available to it? If it is simply a case of making sure there is enough overhead for other processes to run can't you just set the priority of the threads very low and let the Windows scheduler figure it out?

提交回复
热议问题