Alors, j'ai assez bon espoir que la page de manuel dans Ubuntu soit assez similaire à ce que j'ai dans Debian, qui détaille ceci :
/proc/sys/vm/overcommit_memory
This file contains the kernel virtual memory accounting mode. Values are:
0: heuristic overcommit (this is the default)
1: always overcommit, never check
2: always check, never overcommit
In mode 0, calls of mmap(2) with MAP_NORESERVE are not checked, and the default check is very weak, leading to the risk of getting a process "OOM-killed".
In mode 1, the kernel pretends there is always enough memory, until memory actually runs out. One use case for this mode is scientific computing applications that employ large sparse arrays. In Linux kernel versions before 2.6.0, any nonzero value implies mode 1.
In mode 2 (available since Linux 2.6), the total virtual address space that can be allocated (CommitLimit in /proc/meminfo) is calculated as
CommitLimit = (total_RAM - total_huge_TLB) * overcommit_ratio / 100 + total_swap
where:
total_RAM is the total amount of RAM on the system;
total_huge_TLB is the amount of memory set aside for huge pages;
overcommit_ratio is the value in /proc/sys/vm/overcommit_ratio; and
total_swap is the amount of swap space.
For example, on a system with 16GB of physical RAM, 16GB of swap, no space dedicated to huge pages, and an overcommit_ratio of 50, this formula yields a CommitLimit of 24GB.
Since Linux 3.14, if the value in /proc/sys/vm/overcommit_kbytes is nonzero, then CommitLimit is instead calculated as:
CommitLimit = overcommit_kbytes + total_swap
See also the description of /proc/sys/vm/admiin_reserve_kbytes and /proc/sys/vm/user_reserve_kbytes.
Et la description des différents modes me semble bien expliquer ce que tu cherchais à comprendre, non ?
[^] # Re: /proc/sys/vm/overcommit_memory
Posté par Cyril Brulebois (site web personnel) . En réponse au message pourquoi malloc peut échouer alors que linux utilise de la mémoire virtuelle. Évalué à 3.
Alors, j'ai assez bon espoir que la page de manuel dans Ubuntu soit assez similaire à ce que j'ai dans Debian, qui détaille ceci :
Et la description des différents modes me semble bien expliquer ce que tu cherchais à comprendre, non ?
(Pour la visualiser en ligne : https://manpages.debian.org/buster/manpages/proc.5.en.html)
Debian Consultant @ DEBAMAX