On Fri 07 Dec 2007, Torsten Foertsch wrote:
On Fri 07 Dec 2007, Thomas Hertweck wrote:
Die ausfuehrliche Formel lautet:
address space = swap + (1.0 + overcommit_ratio/100.0) * RAM
OK, das macht Sinn. Ratio gibt also an wieviel % des RAM virtuell nochmal zum Adreßraum dazugerechnet wird.
Die Formel address space = swap + overcommit_ratio/100 * RAM stimmt doch. Das hier stammt aus mm/mmap.c: allowed = (totalram_pages - hugetlb_total_pages()) * sysctl_overcommit_ratio / 100; /* * Leave the last 3% for root */ if (!cap_sys_admin) allowed -= allowed / 32; allowed += total_swap_pages; Daraufhin habe ich ein System ohne Swap konfiguriert. Swap ist hier eh nur ein zusätzlicher Summand. Die Kiste hat 512 MB RAM. a.out ist im weiteren Thomas' Programm ohne memset, also ohne Zugriffe auf die Seiten, a.out2 das mit memset. Ist nun overcommit_ratio=0, läuft nichts mehr. Fork liefert ENOMEM. Mit overcommit_ratio=100 enden sowohl a.out als auch a.out2 bei 456MB. oom-killer wird nicht aktiv. Mit overcommit_ratio=200 läuft a.out bis 943MB und endet normal. a.out2 wird nach 471MB vom oom-killer gekillt. Ab overcommit_ratio von ca. 104 wird der oom-killer aktiv. Was lehrt uns das? Um den oom-killer zu verhindern, kann man overcommit_ratio bis 100 erhöhen. Über 100 wird er aktiv. Die Diskrepanz zwischen 456MB bei ratio=100 und 471MB bei ratio=104 (oder 200) bedeutet wohl, daß es schon in dieser Minimalinstallation 15MB RAM gibt, die zwar allokiert, aber nie benutzt werden. Wieso nun ratio als Standardwert 50 hat, ist mir ein Rätsel. Torsten -- A: It reverses the normal flow of conversation. Q: What's wrong with top-posting? A: Top-posting. Q: What's the biggest scourge on plain text email discussions? -- Um die Liste abzubestellen, schicken Sie eine Mail an: opensuse-de+unsubscribe@opensuse.org Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken Sie eine Mail an: opensuse-de+help@opensuse.org