Bug 190957 - Use random() instead of begin() to limit cache sizes
Summary: Use random() instead of begin() to limit cache sizes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 190953
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-26 05:53 PDT by Antti Koivisto
Modified: 2018-10-26 10:08 PDT (History)
4 users (show)

See Also:


Attachments
patch (8.07 KB, patch)
2018-10-26 06:48 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2018-10-26 05:53:29 PDT
We use cache.remove(cache.begin()) pattern to limit sized of various caches. This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the keys get permanently stuck in the table.
Comment 1 Antti Koivisto 2018-10-26 06:48:42 PDT
Created attachment 353180 [details]
patch
Comment 2 Chris Dumez 2018-10-26 08:10:54 PDT
Red bubbles.
Comment 3 Antti Koivisto 2018-10-26 08:19:02 PDT
(In reply to Chris Dumez from comment #2)
> Red bubbles.

Because of the blocking bug.
Comment 4 Chris Dumez 2018-10-26 08:42:29 PDT
(In reply to Antti Koivisto from comment #3)
> (In reply to Chris Dumez from comment #2)
> > Red bubbles.
> 
> Because of the blocking bug.

Oh duh, I was on my phone, sorry.
Comment 5 Chris Dumez 2018-10-26 08:43:54 PDT
Comment on attachment 353180 [details]
patch

r=me
Comment 6 WebKit Commit Bot 2018-10-26 10:07:58 PDT
Comment on attachment 353180 [details]
patch

Clearing flags on attachment: 353180

Committed r237463: <https://trac.webkit.org/changeset/237463>
Comment 7 WebKit Commit Bot 2018-10-26 10:07:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2018-10-26 10:08:42 PDT
<rdar://problem/45591018>