Bug 175571 - MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes
Summary: MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Charlie Turner
Keywords: InRadar
Depends on:
Reported: 2017-08-15 08:45 PDT by Charlie Turner
Modified: 2017-08-21 05:59 PDT (History)
5 users (show)

See Also:

Patch (2.17 KB, patch)
2017-08-15 08:47 PDT, Charlie Turner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Turner 2017-08-15 08:45:24 PDT
After the grand move from WebKit2 -> WebKit, I was struggling to find information about these caching policies and what exactly they mean. The problem is that calculateMemoryCacheSizes fails to set cacheTotalCapacity to something sensible if the system has less than 512MB of RAM. This,

        // 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);

Then obviously violates the checks in MemoryCache::setCapacities, because at this point cacheTotalCapacity is zero from the callsite.

Patch basically follows the pattern to make sure cacheTotalCapacity is set.
Comment 1 Charlie Turner 2017-08-15 08:47:24 PDT
Created attachment 318118 [details]
Comment 2 Charlie Turner 2017-08-15 08:49:43 PDT
Adding Sam, because I have no idea who's best to review this patch, and you were the last one I saw doing things with this area, sorry :)
Comment 3 Charlie Turner 2017-08-21 04:36:11 PDT
Please may someone cq+ this for me? I'm not a commiter.
Comment 4 WebKit Commit Bot 2017-08-21 05:59:03 PDT
Comment on attachment 318118 [details]

Clearing flags on attachment: 318118

Committed r220963: <http://trac.webkit.org/changeset/220963>
Comment 5 WebKit Commit Bot 2017-08-21 05:59:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2017-08-21 05:59:38 PDT