Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Kernel 'Reserved' Memory

I am trying to compile a kernel ( 3.14, arm64 arch ) for a low memory system ( 16MB ram ). I have managed to turn off all the features that I dont need, basically no devices, no fs, no modules, no ZONE_DMA, a very very basic kernel.

However, when I boot the kernel I see this:

Memory: 860K/16384K available (789K kernel code, 67K rwdata, 56K rodata, 64K init, 38K bss, 15524K reserved)

  • What is this reserved memory?

  • How can I reduce this? The reserve eats up a lot of my RAM, leaving only 860K available

Thanks in advance!

like image 279
eldukae Avatar asked Nov 10 '22 18:11

eldukae


1 Answers

It is the minimum amount of memory that should always be there to satisfy critical memory allocations. Setting it too low might lead to a broken system and setting to high might instantly OOM your system. You can modify this value by writing to /proc/sys/vm/min_free_kbytes.

To read it:

$ cat /proc/sys/vm/min_free_kbytes 
67584

To set it to 1024KB (1MB):
$ echo 1024 > /proc/sys/vm/min_free_kbytes

like image 88
Karim Manaouil Avatar answered Nov 15 '22 05:11

Karim Manaouil