GC marking threads should clear malloc caches
Created attachment 245740 [details] Patch
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
Committed r179411: <http://trac.webkit.org/changeset/179411>
Committed r179412: <http://trac.webkit.org/changeset/179412>
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.
Also, maybe I dunno what scavenging is...
> 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?
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.
Another idea might be to only clear the caches during collections caused by the GCTimer.
Reopening to attach new patch.
Created attachment 245755 [details] Patch
Committed r179422: <http://trac.webkit.org/changeset/179422>
Looks like some JSC tests are failing on the bots after this change? https://build.webkit.org/builders/Apple%20Yosemite%20Debug%20WK2%20%28Tests%29/builds/1796/steps/jscore-test/logs/stdio
See also: https://build.webkit.org/builders/Apple%20Mavericks%20LLINT%20CLoop%20%28BuildAndTest%29/builds/11932/steps/webkit-jsc-cloop-test/logs/stdio
Turned out to be a sporadic failure in that date test.