Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting limit to total physical memory available in Linux

I know that I am supposed to set mem=MEMORY_LIMIT. But I do not know where to go, during runtime, or during boot time, in order to set a limit to the total physical memory that the OS has control of.

I am running I/O benchmarks, and I would like to limit the amount of overall physical memory that is available.

like image 820
KZcoding Avatar asked Nov 20 '12 23:11

KZcoding


People also ask

How much physical memory is free Linux?

Linux free -m1024 MB is the total system memory available, which would be physical RAM. 1 MB and 823 MB both show free because an application has access to both for memory storage.


1 Answers

I found the answer I was looking for. Basically, the parameter that sets the total available physical memory is "mem=MEMORY_LIMIT". And this is a kernel boot parameter. You need to add, say "mem=1G" for maximum of 1GB available physical memory to the kernel boot parameter. For more info on how to add kernel boot parameters look at https://wiki.ubuntu.com/Kernel/KernelBootParameters

like image 75
KZcoding Avatar answered Oct 02 '22 13:10

KZcoding