问题
It's a little strange I know, but I want to limit a program (for example the winrar app) resource usage.
The reason: I have an old laptop, with overheating problem, so if I want to do a calculate intensive task (compress a >10GB folder), my laptop overheats and turns off.
The question: Is it possible to limit an application's resource/CPU usage? For example, can I set somehow, that winrar can only use my CPU's 50%?
I use windows 8.1, but answer for other OS is welcome.
回答1:
See Are there solutions that can limit the CPU usage of a process? for general answer.
WinRAR itself has the command line switch -ri
, see in help of WinRAR the page with title:
Switch -RI<p>[:<s>] - set priority and sleep time
For example using a command line like
WinRAR.exe a -ri1:100 Backup.rar *
results in compressing all files in current working directory with default settings using lowest task priority and with 100 ms sleep time between each read or write operation.
来源:https://stackoverflow.com/questions/21214318/set-an-applications-resource-limits-cpu-usage