Linux Overcommit Flag

Source: Internet
Author: User

There is a overcomit configuration in Linux, which is related to the performance of the system (heuristic allow, no check, or block) when the process is requesting memory resources too much.

/proc/sys/vm/overcommit_memory This file contains the kernelVirtualmemory Accounting mode. Values are:0: Heuristic Overcommit ( This  isThedefault)              1: Always overcommit, never check2: Always check, never overcommit in mode0, calls of Mmap (2) with Map_noreserve is notchecked, and thedefaultCheck isvery weak, leading to the risk of getting a process"oom-killed". In mode2(Available since Linux2.6), the totalVirtualaddress space that can be allocated (Commitlimitinch/proc/mem‐info) isCalculated asCommitlimit= (total_ram-total_huge_tlb) *Overcommit_ratio/ -+ Total_swap

A detailed understanding can be found in this blog: http://linuxperf.com/?p=102

In the actual project, if the machine is running Redis, the general will turn Overcomit into 1 (https://redis.io/topics/faq# Background-saving-fails-with-a-fork-error-under-linux-even-if-i-have-a-lot-of-free-ram)

1 >/proc/sys/vm/overcommit_memory:)

When running FFMEPG, it will also be set to 1. Avoid FFMEPG some processes have an internal error while requesting memory.

The root cause is that the process has requested so much memory that it does not necessarily occupy so much memory, and that the allocation of physical RAM pages takes place in the moment of use, not at the moment of application. So we can allow the system to overcommit, meet the process request, can be cgroup memory to limit the user to use the upper limit.

Linux Overcommit Flag

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.