How to keep executable code in memory even under memory pressure ? in Linux

前端 未结 3 1893
自闭症患者
自闭症患者 2020-12-31 12:45

The goal here is to keep every running process\' executable code in memory during memory pressure, in Linux.
In Linux, I am able to instantly (1 sec) cause high memory p

3条回答
  •  执念已碎
    2020-12-31 13:10

    The memory.min parameter in the cgroups-v2 memory controller should help.

    Namely, let me quote:

    "Hard memory protection. If the memory usage of a cgroup is within its effective min boundary, the cgroup’s memory won’t be reclaimed under any conditions. If there is no unprotected reclaimable memory available, OOM killer is invoked."

    https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html

提交回复
热议问题