5 ms·
Just fill /dev/shm via dd or similar. dd if=/dev/zero of=/dev/shm/fill bs=1k count=1024k (option #2 is to limit the amount of ram available to the kernel
by ck2 13y ago
Just fill /dev/shm via dd or similar.
dd if=/dev/zero of=/dev/shm/fill bs=1k count=1024k
(option #2 is to limit the amount of ram available to the kernel via grub.conf, see my comment below)
- levosmetalo 13y agoBut would that really help for "low resource" testing, since OS will just swap out that unused filled zeroes to clean up some space for actually running programs? Maybe creating a VM with just as much memory as the target system would be a better solution to get more predictable results?
- wcchandler 13y agoI wouldn't bother with a full blown VM -- LXC might be relevant.
- ck2 13y agoThere is a way from grub to limit the amount of memory the kernel boots with. Probably easiest way if you want low memory without fiddling. mem=1G mem=512M etc.
- pilif 13y agothat reminds me of that day when I set mem = 512 before rebooting. Ever since then, I know why my primary school teacher always got pissed when we left off the units :-) On a related note: Yes. The kernel needs more than 512 bytes of RAM to boot - even back in the 2.2 days (when this took place)
- simias 13y agoCan't shm end up in swap however? If so it might be necessary to make sure there's no active swap partition otherwise all this unused allocated memory will end up in it pretty quickly.
- ccozan 13y agoI think this is the best solution, with swapoff -a of course. If you use programs that keep memory allocated, the modern kernels will kill them at some point, before chocking. You can/should then disable that though, see some good article here: http://www.oracle.com/technetwork/articles/servers-storage-dev/oom-killer-1911807.html http://www.oracle.com/technetwork/articles/servers-storage-d...