Overcommit_Memory and Overcommit_Ratio

Overcommit_Memory and Overcommit_Ratio

Here is my current setting:

vm.overcommit_ratio = 50 (default)
vm.overcommit_memory = 2

And Current Memory Usage:

[localhost~]$ free -g
             total       used       free     shared    buffers     cached
Mem:            47         46          0          0          0         45
-/+ buffers/cache:          1         45
Swap:           47          0         47

As per the documentation what I understood is:

vm.overcommit_memory = 2 will not allow to overcommit memory than 50 % of RAM (as vm.overcommit_ratio is 50) but still I can see that current memory usage is 46 GB out of 47 GB.

Did I misunderstand something?

0

1 Answer

From your documentation link:

2 — The kernel fails requests for memory that add up to all of swap plus the percent of physical RAM specified in /proc/sys/vm/overcommit_ratio

In your case, you have 47gB RAM, 47gB swap and overcommit_ratio is 50 so a the total memory used can go up to 47+47*.5=70.5gB.

Your currently used memory is 46gB in RAM and 0gB in swap so a total of 46gB which is still under the limit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.