/proc/sys/vm/overcommit_memory

Paweł Sikora pluto at agmk.net
Sun Sep 4 08:49:51 CEST 2011


witam,

chcialbym dodac do domyslnego sysctl.conf pewne konserwatywne ustawienia,
ktore ograniczna radosna tworczosc kernela przy alokacji pamieci i jeszcze
radosniejsze strzelanie z oom-a. proponuje ustawic konserwatywnie tryb 2
i ratio na 0 zeby malloc() jednak zwracal null, a nie wpuszczal procesy w maliny.

legenda:

/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 set are not checked, and the default check is very weak, leading to the risk of getting a process "OOM-killed". Under Linux 2.4 any non-zero value implies mode 1. In mode 2 (available since Linux 2.6), the total virtual address space on the system is limited to (SS + RAM*(r/100)), where SS is the size of the swap space, and RAM is the size of the physical memory, and r is the contents of the file /proc/sys/vm/overcommit_ratio. 

/proc/sys/vm/overcommit_ratio 
See the description of /proc/sys/vm/overcommit_memory.


More information about the pld-devel-pl mailing list