Monday, January 30, 2017

Linux overcommit memory setting


According to this document: https://www.kernel.org/doc/Documentation/vm/overcommit-accounting , if I set "vm.overcommit_memory" to "2", then "The total address space commit for the system is not permitted to exceed swap + a configurable amount (default is 50%) of physical RAM." Also, "The overcommit amount can be set via 'vm.overcommit_ratio' (percentage) or 'vm.overcommit_kbytes' (absolute value)."


My question is, are the "vm.overcommit_ratio" and "vm.overcommit_kbytes" limiting the total sum of memory commit by all processes, or just limiting each process?


I think it should be the latter, because it makes no sense to limit the system to use only half of physical memory in total, but the description in the document suggests it is limiting globally.


Answer



It is global. The purpose of the setting is to make sure that you can not use up all of your memory and cause the OOM killer to start killing processes.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...