Set an application's resource limits (CPU usage)

為{幸葍}努か 提交于 2019-12-13 08:22:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!