The documentation on https://www.kernel.org/doc/Documentation/filesystems/proc.txt says: "The CommitLimit is calculated with the following formula: CommitLimit = ('vm.overcommit_ratio' * Physical RAM) + Swap" Variables on my system: vm.overcommit_ratio = 50 Physical RAM = 16 GiB SwapTotal = 16776188 KiB /proc/meminfo says "CommitLimit: 24993316 kB". Now lets see if this is correct: CommitLimit = (50 * 16777216 KiB) + 16776188 KiB; CommitLimit = 855636988 KiB. The result from the formula does not match with the value reported by the kernel. It is more likely that 'vm.overcommit_ratio' must be devided by 100 and "Physical RAM" must be replaced by the available memory (reported on my system as "MemTotal: 16434260 kB"). The new formula looks this: CommitLimit = ('vm.overcommit_ratio' / 100 * 'MemTotal') + 'SwapTotal'. The result will be: CommitLimit = (50 / 100 * 16434260 KiB) + 16776188 KiB; CommitLimit = 24993318 KiB. There is a difference of 2 KiB to the reported value but maybe this comes from internal rounding.
You're right that the documentation is wrong. I've updated the proc(5) man page with the correct formula: CommitLimit = ([total RAM pages] - [total huge TLB pages]) * overcommit_ratio / 100 + [total swap pages] (See the kernel source file fs/proc/meminfo.c.)
Hello, I am beginner and would like to fix this bug. Is it still open?
Resolved a while ago; should have been closed already.
The online documentation does still contain the old formula, does it maybe get always updated at a later time?
Which online documentation? You can see the update at http://man7.org/linux/man-pages/man5/proc.5.html
I was referring to the link I have posted in the startpost: https://www.kernel.org/doc/Documentation/filesystems/proc.txt I'm still seeing the old formula there.
Okay -- sorry, that bug still remains then. Reopening.
I lookied into the man pages and the change has been updated there. So we need to make changes in the following file: https://www.kernel.org/doc/Documentation/filesystems/proc.txt Where can I get to download the code for that?
should be closed as I see it.