<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 - calculateMemoryCacheSizes incorrectly pins cacheMaxDeadCapacity"
   href="https://bugs.webkit.org/show_bug.cgi?id=163559">163559</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>calculateMemoryCacheSizes incorrectly pins cacheMaxDeadCapacity
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>WebKit Nightly 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>Severity</th>
          <td>Normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>WebKit2
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>krollin&#64;apple.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>akling&#64;apple.com, cgarcia&#64;igalia.com, ggaren&#64;apple.com, koivisto&#64;iki.fi
          </td>
        </tr></table>
      <p>
        <div>
        <pre>WebKit2/Shared/CacheModel.cpp has the following:

        // Object cache capacities (in bytes)
        // (Testing indicates that value / MB depends heavily on content and
        // browsing pattern. Even growth above 128MB can have substantial
        // value / MB for some content / browsing patterns.)
        if (memorySize &gt;= 2048)
            cacheTotalCapacity = 128 * MB;
        else if (memorySize &gt;= 1536)
            cacheTotalCapacity = 96 * MB;
        else if (memorySize &gt;= 1024)
            cacheTotalCapacity = 64 * MB;
        else if (memorySize &gt;= 512)
            cacheTotalCapacity = 32 * MB;

        cacheMinDeadCapacity = cacheTotalCapacity / 4;
        cacheMaxDeadCapacity = cacheTotalCapacity / 2;

        // This code is here to avoid a PLT regression. We can remove it if we
        // can prove that the overall system gain would justify the regression.
        cacheMaxDeadCapacity = std::max(24u, cacheMaxDeadCapacity);

That last line looks like it should use 24 * MB rather than just 24u. Geoff Garen wrote the original code. He says:

<span class="quote">&gt; You’re right — that code is clearly wrong. I’d suggest deleting it.
&gt; 
&gt; Perhaps the code was right at one time but became wrong over time through refactoring.
&gt; 
&gt; Anyway, the PLT it speaks of is an old PLT we don’t run anymore, so we don’t need to worry about it.
&gt; 
&gt; It looks like this means that 512MB devices only get 16MB of dead object cache. That’s pretty small for today’s internet — only one or two pages. Still, it might be appropriate, since 512MB is pretty small.</span >

This change should probably be made by someone who knows the ins-and-outs of testing the effect of the change, so cc'ing the last few people who touched this file in case they are interested in taking it.</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>