[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Disable RAM



>> I want to test how a program would run with a reduced physical
>> memory. The machine has currently 4 GB RAM running Debian. I'd
>> like to evaluate the performance of the system with 2 GB physical
>> RAM. Of course, I could remove on of the RAM modules. But, is
>> there also a way to disable the physical memory by software?

> At boot time specify the "mem=VALUE" parameter to the linux kernel.
> This is easily done with grub at the grub boot screen by adding the
> parameter to the end of the existing boot options.

>   /boot/vmlinuz-2.6.18-4-686 root=/dev/hda5 ro mem=2G

Or without rebooting, or should be able to eat up 2GB or RAM by writing
a little program (run as root, obviously) which allocates 2GB and locks
those pages in RAM (a feature typically used to satisfy real-time contraints
or to ensure a piece of sensitive information is never written to disk).

Try "man mlock".


        Stefan



Reply to: