<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - MemoryPressureHandler doesn't work if cgroups aren't present in Linux"
   href="https://bugs.webkit.org/show_bug.cgi?id=155255">bug 155255</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #273833 is obsolete</td>
           <td>
               &nbsp;
           </td>
           <td>1
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Attachment #282544 Flags</td>
           <td>
               &nbsp;
           </td>
           <td>review?
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - MemoryPressureHandler doesn't work if cgroups aren't present in Linux"
   href="https://bugs.webkit.org/show_bug.cgi?id=155255#c27">Comment # 27</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - MemoryPressureHandler doesn't work if cgroups aren't present in Linux"
   href="https://bugs.webkit.org/show_bug.cgi?id=155255">bug 155255</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=282544&amp;action=diff" name="attach_282544" title="Different approach">attachment 282544</a> <a href="attachment.cgi?id=282544&amp;action=edit" title="Different approach">[details]</a></span>
Different approach

This is a different approach to the previous patch. If there' no other way than polling an parsing /proc/meminfo, let's try to minimize the problems. There's a memory pressure handler in every secondary process, not only the web process but also in the network and plugin processes. So, this patch does the polling in a thread in the UI process to ensure it's only one process waking up. It uses eventFD to notify the other processes about memory pressure. The poll interval is calculated depending on the memory usage in every moment, between 1 and 15 seconds, to try to wake up less often when memory usage is low. Also instead of using a fixed size in MB of free memory as a threshold, it uses a percentage of the memory used. Everything can be configured just modifying some global variables in case any of the values I set is not good enough. And finally instead of using the MemFree value from /proce/meminfo, it uses the MemAvailable value, that was added to the kernel in version 3.somethin
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>