<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Linux] Memory values shown by memory pressure handler logger are not useful"
   href="https://bugs.webkit.org/show_bug.cgi?id=164589">164589</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[Linux] Memory values shown by memory pressure handler logger are not useful
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Local Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>Gtk
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Platform
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cgarcia&#64;igalia.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bugs-noreply&#64;webkitgtk.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We are currently using the VmSize field from /proc/self/status which is the virtual memory size of the process and doesn't normally change even when the memory pressure handler manages to release memory. So, most of the time we see that there's no changes in memory usage in the logs:

Memory pressure relief: Empty the PageCache: =dirty (at 8351166464 bytes)
Memory pressure relief: Prune MemoryCache live resources: =dirty (at 8351166464 bytes)
Memory pressure relief: Drain CSSValuePool: =dirty (at 8351166464 bytes)
Memory pressure relief: Discard StyleResolvers: =dirty (at 8351166464 bytes)
Memory pressure relief: Discard all JIT-compiled code: =dirty (at 8351166464 bytes)
Memory pressure relief: Dropping buffered data from paused media elements: =dirty (at 8351166464 bytes)
Memory pressure relief: Purge inactive FontData: =dirty (at 8351166464 bytes)
Memory pressure relief: Clear WidthCaches: =dirty (at 8351166464 bytes)
Memory pressure relief: Discard Selector Query Cache: =dirty (at 8351166464 bytes)
Memory pressure relief: Prune MemoryCache dead resources: =dirty (at 8351166464 bytes)
Memory pressure relief: Prune presentation attribute cache: =dirty (at 8351166464 bytes)
Memory pressure relief: Run malloc_trim: =dirty (at 8351166464 bytes)
Memory pressure relief: Release free FastMalloc memory: =dirty (at 8351166464 bytes)

We should use the actual memory used by the process, memory that the process can release and then it's relevant for the memory pressure handler. Using other fields from /proc/self/status we could do something like VmRSS - (RssFile + RssShme), but there's also /proc/self/statm that provides the same information in a single. The main different is that statm provides both resident and shared memory directly, but in number of pages, so we need to multiply by the size of the page.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>