Bug 175571

Summary: MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes
Product: WebKit Reporter: Charlie Turner <cturner>
Component: WebKit APIAssignee: Charlie Turner <cturner>
Status: RESOLVED FIXED    
Severity: Normal CC: clopez, commit-queue, koivisto, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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]
Patch
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]
Patch

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
<rdar://problem/33990750>