JEP 189: Shenandoah: An Ultra-Low-Pause-Time Garbage Collector

Krystal Mok rednaxelafx at gmail.com
Fri Feb 21 23:16:56 UTC 2014


Hi Roman and Christine,

I'd like to ask another question, on object pointer comparison.

Now that the source code has been released, people from the outside can
finally peek into the details ;-)
I've noticed that there's special handling in the interpreter for if_acmp:
http://icedtea.classpath.org/hg/shenandoah/openjdk8/hotspot/file/ae4e705df435/src/cpu/x86/vm/templateTable_x86_64.cpp#l1860

Could you please elaborate a little bit on the design of oop comparison in
Shenandoah?

(P.S. Sad that the FOSDEM presentation video isn't available...)

Thanks,
Kris


On Tue, Feb 4, 2014 at 3:39 PM, Roman Kennke <rkennke at redhat.com> wrote:

> Hi Krystal,
>
>
> > I'd like to ask a couple of questions about the barriers, out of
> > curiosity.
> >
> >
> > The JEP says:
> >
> >
> > "...All reads by the Java Threads indirect through this forwarding
> > pointer. All writes to objects in targeted regions must first copy the
> > object and then write to the object in its new location."
> >
> >
> >
> > Does this mean Shenandoah employs both read and write barriers?
>
> Yes.
>
> >  The read barrier is a Brooks-style barrier, but the write barrier is
> > more than a plain SATB write barrier (as in G1), right?
>
> Right.
>
> > Will Shenandoah try to reuse the existing write barrier logic in
> > HotSpot and extend it to catch all field writes as opposed to just
> > reference field writes, or will it use some other form of write
> > barrier?
>
> It uses the G1 barrier for SATB and extends it for the preemptive
> copying.
>
> We don't use memory protection tricks ;-) Actually we can't, if we
> protecting our from-spaces, which would be a great thing to do, at least
> for debugging, we couldn't update the brooks pointers any more when we
> do the evacuation.
>
> Best regards,
> Roman
>
> > e.g. The Chakra JavaScript engine from Microsoft apparently uses a
> > write barrier implemented via memory protection trick, as noted in one
> > of their blog
> > posts:
> http://blogs.msdn.com/b/ie/archive/2012/06/13/advances-in-javascript-performance-in-ie10-and-windows-8.aspx
> >
> >
> > "Because Chakra's collector works concurrently with the main script
> > thread, the running script may modify or create new objects on pages
> > that have already been processed. To make sure such objects aren't
> > prematurely collected, Chakra write-protects pages before the mark
> > phase starts. Pages that have been written to during the mark phase
> > must be later rescanned on the main script thread. Because leaf
> > objects don't require such processing, pages from the leaf object
> > space don't need to be write-protected or rescanned later. This saves
> > precious time on the main script thread, reducing pauses."
> >
> >
> > Thanks,
> > Kris
> >
> >
> > On Fri, Jan 17, 2014 at 11:28 AM, Roman Kennke <rkennke at redhat.com>
> > wrote:
> >         Hi there,
> >
> >         Sorry being so silent... we are very happy that the Shenandoah
> >         JEP has
> >         finally been posted and would welcome any comments, questions,
> >         discussion from the community.
> >
> >         Cheers,
> >         Roman
> >
> >         Am Mittwoch, den 15.01.2014, 11:49 -0800 schrieb
> >         mark.reinhold at oracle.com:
> >         > Posted: http://openjdk.java.net/jeps/189
> >         >
> >         > - Mark
> >
> >
> >
> >
> >
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20140221/ba4f194b/attachment.htm>


More information about the hotspot-gc-dev mailing list