Bug 51434 - RegExpCache holds on to too much executable memory.
Summary: RegExpCache holds on to too much executable memory.
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-21 17:22 PST by Gavin Barraclough
Modified: 2010-12-21 19:32 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2010-12-21 17:22:05 PST
RegExpCache may hold on to too much memory for three reasons:

(1) Caching 256 RegExps might be too man, for some platforms.
(2) The RegExpCache gives regular expressions a very different lifetime to JIT translations of JS code, but they share an ExecutableAllocator, and thus share ExecutablePools.  This means the RegExpCache may end up keeping the JIT code for translations of JS code alive.
(3) Regular expressions in the RegExpCache may be sharing ExecutablePools.  If this is the case, rejecting a single RegExp object won't actually free up any memory.  This means the cache holds onto complied regular expressions that it cannot vend.
Comment 1 Gavin Barraclough 2010-12-21 17:31:50 PST
Patch landed in r74441 addresses the first two issues, but the third concern still needs to be addressed.  The best resolution to this may be to remove the pooling of executable code, allow individual, arbitrary sized allocations.
Comment 2 WebKit Review Bot 2010-12-21 19:32:05 PST
http://trac.webkit.org/changeset/74441 might have broken GTK Linux 64-bit Debug