Windows utility for consuming CPU
I'm looking for a windows utility to consume CPU at a specified percentage so that I can test my app under conditions of restricted process开发者_开发知识库or resources.
I googled around and saw a reference to CPUGRAB.exe, but can't find a download location.
Google for just cpugrab. There are cpugrab.zip
and cpugrab.rar
files all over the place (rapidshare, badongo, etc). They may or may not be legal, I can't comment on that.
Prime95
Max CPU will do some of what you want but doesn't have the percentage granularity.
I beleive you need CPU Speed Adjuster. It is freeware unlike some others:
http://www.softpedia.com/get/Tweak/System-Tweak/CPU-Speed-Adjuster.shtml
On my Windows XP laptop, compiling bogdown.c
:
int main(void) {
int i;
while ( 1 ) ++i;
return 0;
}
w/o any optimizations and then starting two instances uses utilizes both cores to the max and makes starting any program or typing into the textbox on SO a chore.
If you want to make it harder for the OS to take away time slices from bogdown.exe
, you can increase the priorities of the processes in Task Manager, but beware, your system may become very unresponsive.
If you want to simulate limited memory, calloc
(not malloc
) a gigabyte or two of memory in bogdown.exe
.
Another alternative is to have at least a couple of programs encoding video while you test your app.
I wrote an Open Source (MIT) replacement for CPUGrab.exe in C#. This came about due to my reluctance to rely on (sometimes) shady download sites purporting to have 'cpugrab.zip'. It seems to work pretty well for SimCopter on my Win98 VM. :)
The tool can be found here: CPUGrab.NET
精彩评论