Mik*_*kov 4 linux kernel memory
我在内核设置中(在 sysctl 中)遇到了以下参数:
vm.min_free_kbytes
Run Code Online (Sandbox Code Playgroud)
这是无论如何始终可用的可用内存 (RAM) 量。就我而言,我只有 1 GiB 的 RAM,并且此参数设置为大约 64MiB。我认为这相当高,所以到目前为止我将其降低到 8MiB。我不知道我是否可以进一步降低它,或者将它降低到 8MiB 是否会引起任何麻烦,所以问题是如果空闲内存量太低会发生什么?我可以安全地将值降低到 1MiB 吗?
应该是安全的,但不能保证它。从内核文档:
min_free_kbytes:
This is used to force the Linux VM to keep a minimum number
of kilobytes free. The VM uses this number to compute a
watermark[WMARK_MIN] value for each lowmem zone in the system.
Each lowmem zone gets a number of reserved free pages based
proportionally on its size.
Some minimal amount of memory is needed to satisfy PF_MEMALLOC
allocations; if you set this to lower than 1024KB, your system will
become subtly broken, and prone to deadlock under high loads.
Setting this too high will OOM your machine instantly.
Run Code Online (Sandbox Code Playgroud)
基本上,如果您将其设置为低,您将遇到内存分配问题。
| 归档时间: |
|
| 查看次数: |
8468 次 |
| 最近记录: |