I want to test a program's memory management capabilities, for example (say, program name is director)
- What happens if some other processes take up too much memory, and there is too less memory for director to run? How does director behave?
- What happens if too many of the CPU cycles are used by some other program while director is running?
- What happens if memory used by the other programs is freed after sometime? How does director claim the memory and start working at full capabilities. etc.
I'll be doing these experiments on a Unix machine. One way is to limit the amount of memory available to the process using ulimit
, but there is no good way to have control over the CPU cycle utilization.
I have another idea. What if I write some program in C or C++ that acts as a dynamic memory and CPU filler, i.e. does nothing useful but eats up memory and/or CPU cycles anyways?
- I need some ideas on how such a program should be structured. I need to have dynamic(runtime) control over memory used and CPU used.
- I think that creating a lot of threads would be a good way to clog up the CPU cycles. Is that right?
Is there a better approach that I can use?
Any ideas/suggestions/comments are welcome.