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

6 lines
554 B
Markdown
Raw Normal View History

2025-03-01 23:45:36 +08:00
- 当内存过量提交之后会出现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禁用比较好。