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

6 lines
554 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- 当内存过量提交之后会出现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禁用比较好。