<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 5/7/14, 12:36 PM, Luc R. wrote:<br>
    <blockquote
cite="mid:CAHH9g-HPtgpMpCiyrYeHwgTtWqJCY=79czZL-s3DdhdPbz_ebQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks Benjamin. Do I understand right that the
        MemoryPressureHandler is an additional mechanism to reduce
        memory on top of other things, but is not the root cause of
        memory increase at first place?</div>
    </blockquote>
    Yes, MemoryPressureHandler is one of our tools for managing memory,
    not the cause.<br>
    <br>
    The way WebKit runs nowadays is: use as much memory as needed to
    improve the runtime performance (while being reasonable of course).
    When the system needs the memory back, MemoryPressureHandler clears
    the major caches and return the memory to the system.<br>
    <br>
    It is a common pattern from OS X: if there is spare memory
    available, use if for runtime performance. When memory becomes
    scarce, the operating system reclaim memory from the processes that
    do not require high performance at this time.<br>
    <blockquote
cite="mid:CAHH9g-HPtgpMpCiyrYeHwgTtWqJCY=79czZL-s3DdhdPbz_ebQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>An extra  information on memory pattern:</div>
        <div>For the new code, amount of committed memory is actually
          less for about 2x on average (say 150M vs 300M per process),
          but private memory is higher say 100M vs 60M per process, as
          well as is the working set. The scenario is a continuous
          processing a URL list until process crashing. My
          interpretation that somehow processes burn more physical
          memory, instead of letting it page out to disk. Does it make
          sense?</div>
        <div><br>
        </div>
        <div>This looks like a dramatic change. Are there any major
          changes in memory management in the last 2 years? Are there
          any sensitive settings which can be tuned up?</div>
      </div>
    </blockquote>
    WebKit is an extremely active project, there are several hundred
    changes every day. Some subsystems have been entirely rewritten in
    the last two years. Without more information about which subsystem
    uses more memory, it is impossible for me to guess what is
    happening.<br>
    <br>
    Regarding the settings, you should at least disable the page cache
    since it should be useless for your use case.<br>
    <br>
    If you send the list of objects that are taking more memory, I may
    be able to give more information.<br>
    <br>
    Benjamin<br>
    <br>
    <blockquote
cite="mid:CAHH9g-HPtgpMpCiyrYeHwgTtWqJCY=79czZL-s3DdhdPbz_ebQ@mail.gmail.com"
      type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">On Mon, May 5, 2014 at 6:38 PM,
          Benjamin Poulain <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:benjamin@webkit.org"
              target="_blank">benjamin@webkit.org</a>&gt;</span> wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div class="HOEnZb">
              <div class="h5">On 5/5/14, 6:31 PM, Luc R. wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  Question on memory usage.<br>
                  <br>
                  I am using WinCairo port, and I have recently updated
                  the codebase from<br>
                  about 2 years old one. I am running an automation with
                  multiple<br>
                  instances of WebKit running in parallel, and each
                  instance is processing<br>
                  a list of URLs (until crashes, then it's restarted).<br>
                  <br>
                  I noticed that memory usage on the new codebase is
                  about 60% higher! I<br>
                  don't see substantial differences in the output (which
                  is pretty much<br>
                  outerHTML) and processing speed is about the same.<br>
                  <br>
                  Does anyone have ideas, which feature could have added
                  such a<br>
                  significant increase of memory usage? I would be
                  interested to look into<br>
                  details of how to reduce that back to normal.<br>
                </blockquote>
                <br>
              </div>
            </div>
            WebKit is becoming a lot better at using memory efficiently
            to improve the runtime performance. It could simply be
            better use of the ram.<br>
            <br>
            You should try to wiring the MemoryPressureHandler with your
            system, and see if that makes a difference.<br>
            <br>
            Benjamin<br>
            _______________________________________________<br>
            webkit-help mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:webkit-help@lists.webkit.org" target="_blank">webkit-help@lists.webkit.org</a><br>
            <a moz-do-not-send="true"
              href="https://lists.webkit.org/mailman/listinfo/webkit-help"
              target="_blank">https://lists.webkit.org/mailman/listinfo/webkit-help</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        -Luc
      </div>
    </blockquote>
    <br>
  </body>
</html>