kcwu
kcwu

Reputation: 7011

How can I limit resource usage of process?

In short, I want to find windows equivalent way of unix setrusage() function.

Can I limit resource usage for particular process? For example, 10 seconds cpu time and 50mb memory size. If the process run more than 10 seconds or consumes more than 50mb memory, the process will be terminated by windows.

Upvotes: 4

Views: 709

Answers (2)

Christian
Christian

Reputation: 2957

Try job objects! They even work for groups of processes and spawned processes. I think you can do all these limits using them

Here is more information http://msdn.microsoft.com/en-us/library/ms684161.aspx

Upvotes: 3

Roger Lipscombe
Roger Lipscombe

Reputation: 91825

Look at the documentation for SetInformationJobObject.

Upvotes: 1

Related Questions