在性能测试期间限制 RAM 使用
我必须运行一些性能测试,看看当系统内存不足并且系统开始抖动时我的程序如何工作。理想情况下,我能够更改系统使用的 RAM 量。
我曾尝试在单用户模式下以有限的物理内存启动我的系统(运行 Ubuntu 10.10),但使用我使用的参数(max_addr=300M、max_addr=314572800 或 mem=300M),系统没有使用我的交换分区。
有没有办法限制整个系统使用的 RAM 量,同时仍然使用交换空间?
重点是测量每个程序的总运行时间作为输入大小的函数。我并不是想查明性能问题,而是想比较算法,这意味着我需要准确性。
I have to run some performance tests, to see how my programs work when the system runs out of RAM and the system starts thrashing. Ideally, I would be able to change the amount of RAM used by the system.
I haved tried to by boot my system (running Ubuntu 10.10) in single user mode with a limited amount of physical memory, but with the parameters I used (max_addr=300M, max_addr=314572800 or mem=300M) the system did not use my swap partition.
Is there a way to limit the amount of RAM used by the total system, while still using swap space?
The point is to measure the total running time of each program as a function of the input size. I am not trying to pinpoint performance problems, I am trying to compare algorithms, which means I need accuracy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编写一个简单的c程序,该程序
现在运行该程序(一个或几个进程),以便分配足够的内存来导致正在测试的进程发生抖动。
Write a simple c program which
Now run this program (one or few processes) so that you allocate enough memory to cause the thrashing of process you are testing.