huchuan2025/10-Project/102-上班/心得/问题总结/内存的过量提交 overcommit_memory.md

554 B
Raw Blame History

  • 当内存过量提交之后会出现OOM
  • /proc/sys/vm/overcommit_memory
    • When this flag is 0, the kernel attempts to estimate the amount of free memory left when userspace requests more memory.
    • When this flag is 1, the kernel pretends there is always enough memory until it actually runs out.
    • When this flag is 2, the kernel uses a “never overcommit” policy that attempts to prevent any overcommit of memory. Note that user_reserve_kbytes affects this policy.
  • 感觉对于确定业务的设备, 应该使用2禁用比较好。