Hardware Reference
In-Depth Information
CommitLimit
The documentation states:
Based on the overcommit ratio (
vm.overcommit_ratio
), this is the total
amount of memory currently available to be allocated on the system.
This limit is only adhered to if strict overcommit accounting is enabled
(mode 2 in
vm.overcommit_memory
). The
CommitLimit
is calculated with
the following formula:
27
CommitLimit = (vm.overcommit_ratio × Physical RAM) + Swap
For example, a system with 1 GB of physical RAM and 7 GB of swap with a
vm.overcommit_ratio
of 30 would yield a
CommitLimit
of 7.3 GB. For more details,
see the memory overcommit documentation in
vm/overcommitaccounting
.
The formula can be written as follows:
(
)
+ .
CRrS
=´
The elements of this formula are described here:
•
C
is the overcommit limit.
•
R
is the physical RAM available (
MemTotal
).
•
S
is the swap space available (
SwapTotal
).
•
r
is the overcommit ratio percent (expressed as a fraction).
The overcommit ratio, r, is not reported in the
/proc/meminfo
data. To obtain that
ratio, we consult another pseudo file. This example was taken from a Rev 2.0 Model B, but
it appears to be a value common to all Pis:
$ cat /proc/sys/vm/overcommit_ratio
50
The value 50 is to be interpreted as r = 0.50 (50%).
Using the overcommit formula, the value for S can be computed for the swap space
available:
(
)
SC Rr
=- ´
(
)
=
326892
-
448996 050
´
.
=
326892
-
262144
=
102394
KB