[webkit-help] JavaScriptCore GC on background thread?

Benjamin Poulain benjamin at webkit.org
Thu Apr 25 14:45:11 PDT 2013


On Thu, Apr 25, 2013 at 7:29 AM, Spencer Kohan <spencerkohan at gmail.com>wrote:

> I'm attempting to use JavaScriptCore in a real-time application, and I'm
> running into long pauses for garbage collection as memory usage increases.
>  I've been digging into the GC implementation in an effort to improve
> performance, and I've noticed some references to the compiler directive
> 'PARALLEL_GC' throughout the code, which makes me wonder if there's already
> support for multi-threaded GC, and if so how to enable it.
>

JavaScriptCore uses a parallel Garbage Collector, but it is not concurrent
with the main thread.

When the engines requires to collect memory, the main thread stop and start
the garbage collection. If the space is large enough to justify spawning
threads, the garbage collection happens on as many core as needed to
minimize the collection time.

At the moment, the parallel GC is enabled on Mac OS X, iOS, GTK and
Blackberry.

If you are not using the latest version of WebKit trunk, I suggest you to
update and try again. The garbage collector has improved lately, pause
times have been reduced a lot.
If you still see long pauses with the latest WebKit, it would be worth
looking at the JavaScript code to find if something causes memory trashing.

Benjamin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20130425/0a17810a/attachment.html>


More information about the webkit-help mailing list