Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to simulate different CPU frequency and limit RAM

I have to build a simulator with C#. This simulator should be able to run a second thread with configureable CPU speed and limited RAM size, e.g. 144MHz and 50 MB.
Of course I know that a simulator can never be as accurate as the real hardware. But I try to get almost similar performance.
At the moment I'm thinking about creating a thread which I will stop/sleep from time to time. Depending on the desired CPU speed the simulator should adjust the sleep time of this thread and therefore simulate different cpu frequency. To measure the achieved speed I though about using PerformanceCounters. But with this approach I have the problem that I don't know how to limit the RAM size the thread could use.
Do you have any ideas how to realize such a simulator?

Thanks in advance!!

like image 715
geiserbua Avatar asked May 26 '10 16:05

geiserbua


2 Answers

Limit memory is easy with the virtual machines like vmware. You can change cpu speed with some overclocking tools. For example http://cpu.rightmark.org/products/rmclock.shtml Good luck!

like image 183
skateboard Avatar answered Sep 28 '22 17:09

skateboard


CPU speed limiting? You should check this, perhaps it will useful (to some degree at least). CPU Emulation and locking to a specific clock speed

like image 37
Scorchio Avatar answered Sep 28 '22 17:09

Scorchio