Bug 84476 - JSGarbageCollect should not call collectAllGarbage()
Summary: JSGarbageCollect should not call collectAllGarbage()
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
Depends on:
Reported: 2012-04-20 12:09 PDT by Mark Hahnenberg
Modified: 2012-04-20 12:36 PDT (History)
0 users

See Also:

Patch (1.30 KB, patch)
2012-04-20 12:11 PDT, Mark Hahnenberg
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2012-04-20 12:09:18 PDT
JSGarbageCollect should not synchronously call collectAllGarbage(). Instead, it should notify the GCActivityCallback that it has abandoned an object graph, which will set the timer to run at some point in the future that JSC can decide according to its own policies.
Comment 1 Mark Hahnenberg 2012-04-20 12:11:25 PDT
Created attachment 138139 [details]
Comment 2 Geoffrey Garen 2012-04-20 12:17:14 PDT
Comment on attachment 138139 [details]

Let's fix the FIXME by taking advantage of our new callback, like so:

- Cancel the GC timer at the start of collection (rename didCollect to willCollect)
- If collection causes a didAbandonObjectGraph, it can now start the timer, which will, in fact, cause another collection later.

In the same patch, you can remove the isBusy() check, since didAbandonObjectGraph is safe to call while the heap is busy.
Comment 3 Mark Hahnenberg 2012-04-20 12:36:28 PDT
Committed r114771: <http://trac.webkit.org/changeset/114771>