Limiting RAM Size

Hi Guys,

Is there a way in Linux by which we can limit the RAM size. Like right now my computer's RAM size is 8Gb and I want to limit it to 2 Gb for some benchmark test. When I try to limit it to BIOS setup it shows the RAM size but does not allow me to modify it.

Any ideas?

Thanks a lot in advance.
Check out the setrlimit(2) function, specifically RLIMIT_AS.

If you use bash as your shell, try "help ulimit".
Thanks for the reply dude. Actually, I wanted to set it somehow through BIOS or boot manager. I still have no idea how to do it :(
Last edited on
Does this help get you what you need?

http://redsymbol.net/linux_boot_parameters/

Check the "mem" boot parameter.
Hi PanGalactic ... YOU ARE THE MAN ! ... That's exactly what I needed.
I was using ramdisk_size instead of mem.

Thanks once again dude.
Topic archived. No new replies allowed.