[Webkit-unassigned] [Bug 42756] JIT requires VM overcommit (particularly on x86-64), Linux does not by default support this without swap?

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 20 07:53:25 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=42756





--- Comment #45 from Xan Lopez <xan.lopez at gmail.com>  2011-05-20 07:53:24 PST ---
Hey, good news:

turns out Linux has a flag for mmap that is perfect for this, MAP_NORESERVE. From man proc(5):


       /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".  Under Linux 2.4 any nonzero 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.

--

0 is the default on Linux, so I think if we just add a one-line patch in the code adding this flag by default things should work OK. I'll test this and report back.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list