[Webkit-unassigned] [Bug 65382] The JSC garbage collector returns memory to the operating system too eagerly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 2 12:59:53 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65382





--- Comment #17 from Adam Roben (:aroben) <aroben at apple.com>  2011-08-02 12:59:53 PST ---
(In reply to comment #16)
> (In reply to comment #15)
> > Have you considered using libdispatch or similar to avoid having a dedicated thread for this periodic work?
> 
> This is a good point!  dispatch_after() would be great here.  One thing that I'm not sure about is how easy it is to cancel a dispatch_after(); the Heap destructor will want to ensure that it can immediately prevent the scavenger from running again, unless it is currently running, in which case it should wait for it to finish.  This is very easy to do with threading primitives.

You could use dispatch_suspend to suspend the queue on which the scavenger will run, and use a standard mutex to block until the scavenger finishes running.

> Can we rely on libdispatch being available on all of the platforms that WebKit runs on?

We cannot.

> If it is, then awesome; if not, then I'm dubious about the risk/reward: the risk is that we have two different implementations of the logic for starting, stopping, and scheduling scavenging.  The benefit is that we have one fewer thread.  It's not clear to me that the benefit outweighs the risk.

Ideally we'd have an abstraction that provides the same functionality as libdispatch but with a cross-platform interface. WebKit2's WorkQueue abstraction might be a good starting point.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list