Programmatically limit CPU usage to any application in Windows 7?

I am looking for a way to limit the CPU usage of any application in Windows 7 to 50%. I tried to find a way on the Internet to do this, and it looks like it's easy to do on Linux and Mac OS X (one command in the terminal), but I'm not sure how to do it on Windows 7. Any help would be greatly appreciated. Thanks!

Rohan

+7
windows-7 cpu-usage
source share
5 answers

You can use BES. He asks about processor-consuming applications. You can limit 3 programs maximum. I use this to run several clients of online games, and it works like a charm for me. You must run it using admin privilidges and in windows xp sp3 mode. To configure these parameters, right-click on the executable file and select the parameters.

Here's a link to BES - CPU Limiter.

+6
source share

If you are running a multi-core processor, you can right-click the process in the task manager and set the affinity. This will determine which kernels can run the process. Uncheck half the kernel and the process will use 50%.

Or see how to do this programmatically: Establish affinity with the start / AFFINITY command in Windows 7

+4
source share

You cannot restrict CPU usage to a process in Windows 7 or earlier, since this resource is managed by OS * .

However, you can specify to start the process with a specific priority, for example. to work below normal priority. Different scheduling priorities can be set using the SetPriorityClass API SetPriorityClass .

Planning priorities

What you're probably trying to prevent is that your process affects system performance in a way that the user will notice. In this case, the decision of the respective priorities will be the decision. In the end, you got an expensive processor, so why not use it when you can ?

* See @Ben Voigt for a possible solution on Windows 8 and above.

+3
source share

You can limit the CPU usage to your process or any other process by adding interest to the Job object and placing restrictions on the Job object.

One of the resource limitations that can be configured for Job objects is CPU utilization:

If you need to use JOBOBJECT_BASIC_LIMIT_INFORMATION , note the note:

To register for a notification when this limit is exceeded without completing processes, use the SetInformationJobObject function with the JobObjectNotificationLimitInformation information class

And then use JOBOBJECT_END_OF_JOB_TIME_INFORMATION instead of that available before Windows 8.

+3
source share

You can use a great program called the " lasso process ".

In lasso, you can, for example, limit a specific program to 1 processor and with low priority. Each copy of this program will work with these settings. I used this program to control the processor on a terminal server, and it worked very well!

+1
source share

All Articles