Bug 141097

Summary: GC marking threads should clear malloc caches
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, cdumez, kling, mhahnenb
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch sam: review+

Geoffrey Garen
Reported 2015-01-30 13:35:57 PST
GC marking threads should clear malloc caches
Attachments
Patch (7.69 KB, patch)
2015-01-30 14:11 PST, Geoffrey Garen
no flags
Patch (1.90 KB, patch)
2015-01-30 16:27 PST, Geoffrey Garen
sam: review+
Geoffrey Garen
Comment 1 2015-01-30 14:11:14 PST
Andreas Kling
Comment 2 2015-01-30 14:18:53 PST
Comment on attachment 245740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245740&action=review r=me > Source/JavaScriptCore/ChangeLog:8 > + This is an attempt to amelirate a potential memory use regression ameliorate
Geoffrey Garen
Comment 3 2015-01-30 14:22:52 PST
Geoffrey Garen
Comment 4 2015-01-30 14:27:51 PST
Mark Hahnenberg
Comment 5 2015-01-30 14:50:03 PST
Comment on attachment 245740 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245740&action=review > Source/JavaScriptCore/heap/GCThread.cpp:79 > + WTF::releaseFastMallocFreeMemoryForThisThread(); I wonder if it makes more sense to do this at the end of collection rather than between phases? Seems a shame to clear out the per-thread malloc cache between marking and copying since copying might want to reuse some stuff from the marking phase.
Mark Hahnenberg
Comment 6 2015-01-30 14:54:11 PST
Also, maybe I dunno what scavenging is...
Geoffrey Garen
Comment 7 2015-01-30 15:47:39 PST
> I wonder if it makes more sense to do this at the end of collection rather > than between phases? Yeah, end of collection is better. How to achieve? Maybe move the code to the end of the 'case Copy' block?
Mark Hahnenberg
Comment 8 2015-01-30 16:14:46 PST
Yeah that seems ok. There shouldn't be any parallel work left to do at the end of the CopyPhase, so that sounds like a good time to clear the malloc caches on those threads.
Mark Hahnenberg
Comment 9 2015-01-30 16:17:21 PST
Another idea might be to only clear the caches during collections caused by the GCTimer.
Geoffrey Garen
Comment 10 2015-01-30 16:27:53 PST
Reopening to attach new patch.
Geoffrey Garen
Comment 11 2015-01-30 16:27:54 PST
Geoffrey Garen
Comment 12 2015-01-30 16:29:17 PST
Chris Dumez
Comment 13 2015-01-30 16:34:33 PST
Geoffrey Garen
Comment 15 2015-01-30 17:16:34 PST
Turned out to be a sporadic failure in that date test.
Note You need to log in before you can comment on or make changes to this bug.