Bug 84477

Summary: Heap should cancel GC timer at the start of the collection
Product: WebKit Reporter: Mark Hahnenberg <mhahnenberg>
Component: JavaScriptCoreAssignee: Mark Hahnenberg <mhahnenberg>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ggaren: review+

Description Mark Hahnenberg 2012-04-20 12:20:04 PDT
Currently the Heap cancels the GC timer at the conclusion of a collection. We should change this to be at the beginning because something (e.g. a finalizer) could call didAbandonObjectGraph(), which will schedule the timer, but then we'll immediately unschedule the timer at the conclusion of the collection, thus potentially preventing large swaths of memory from being reclaimed in a timely manner.
Comment 1 Mark Hahnenberg 2012-04-20 12:47:48 PDT
Created attachment 138146 [details]
Patch
Comment 2 Geoffrey Garen 2012-04-20 12:49:28 PDT
Comment on attachment 138146 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=138146&action=review

> Source/JavaScriptCore/API/JSBase.cpp:104
>      if (!globalData.heap.isBusy())

We want to allow this during GC finalizers!
Comment 3 Mark Hahnenberg 2012-04-20 12:53:05 PDT
Created attachment 138147 [details]
Patch
Comment 4 Geoffrey Garen 2012-04-20 12:53:44 PDT
Comment on attachment 138147 [details]
Patch

r=me
Comment 5 Mark Hahnenberg 2012-04-20 12:55:39 PDT
Committed r114772: <http://trac.webkit.org/changeset/114772>