Memory overcommitment
lastmod 2023-10-16created 2023-10-163 edits
What is memory commit?
As the name says, it means allowing more commits. Then what is a commit? When a process requests memory from the kernel, it uses a system call such as malloc(), and the kernel receives the system call request and passes back the address of the corresponding memory region. At this point, because the process may be allocated memory and never use it, the kernel does not bind the allocated memory region to physical memory.
That is, the process thinks it has received the memory, but in reality the memory has not been allocated anywhere in physical memory. This is called memory commit.
How to configure memory overcommit
$ sudo sysctl -a | grep overcommit_memory
vm.overcommit_memory = 0
$ sudo sysctl vm.overcommit_memory=1