vm/min_free_kbytes - Why Keep Minimum Reserved Memory?

后端 未结 3 765
栀梦
栀梦 2021-02-04 01:40

According to this article:

/proc/sys/vm/min_free_kbytes: This controls the amount of memory that is kept free for use by special reserves including “atom

3条回答
  •  我在风中等你
    2021-02-04 02:06

    This memory is kept free from use by normal processes. As @Arno mentioned, the special processes that can run include interrupt routines, which must be run now (as it's an interrupt), and finish before any other processes can run (atomic). This can include things like swapping out memory to disk when memory is full.

    If the memory is filled an interrupt (memory management) process runs to swap some memory into disk so it can free some memory for use by normal processes. But if vm.min_free_kbytes is too small for it to run, then it locks up the system. This is because this interrupt process must run first to free memory so others can run, but then it's stuck because it doesn't have enough reserved memory vm.min_free_kbytes to do its task resulting in a deadlock.

    Also see:

    • https://www.linbit.com/en/kernel-min_free_kbytes/ and
    • https://askubuntu.com/questions/41778/computer-freezing-on-almost-full-ram-possibly-disk-cache-problem (where the memory management process has so little memory to work with it takes so long to swap little by little that it feels like a freeze.)

提交回复
热议问题