<p dir="ltr">Hi Roman,</p>
<p dir="ltr">I know I asked this question initially, but don't feel that I quite understood Christine's answer: what can we expect, in terms of gc performance, as compared to Azul C4? As far as I know, C4 is a software only collector as well (Azul CPUs have some hardware instructions to make it faster, but it also runs on x64).  C4 claims some pretty impressive pause times, so why not follow their design? I think they (Azul) have at least 1 white paper on the algorithms/design.  I'm framing the question this way not to doubt what you guys are doing, but rather understand the thinking behind taking your approach; I can only surmise that the folks involved researched current state of the art in this space, and must have some reasons for going with Brooks style forwarding pointers.</p>

<p dir="ltr">Thanks</p>
<p dir="ltr">Sent from my phone</p>
<div class="gmail_quote">On Feb 4, 2014 6:42 PM, "Roman Kennke" <<a href="mailto:rkennke@redhat.com">rkennke@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Krystal,<br>
<br>
<br>
> I'd like to ask a couple of questions about the barriers, out of<br>
> curiosity.<br>
><br>
><br>
> The JEP says:<br>
><br>
><br>
> "...All reads by the Java Threads indirect through this forwarding<br>
> pointer. All writes to objects in targeted regions must first copy the<br>
> object and then write to the object in its new location."<br>
><br>
><br>
><br>
> Does this mean Shenandoah employs both read and write barriers?<br>
<br>
Yes.<br>
<br>
>  The read barrier is a Brooks-style barrier, but the write barrier is<br>
> more than a plain SATB write barrier (as in G1), right?<br>
<br>
Right.<br>
<br>
> Will Shenandoah try to reuse the existing write barrier logic in<br>
> HotSpot and extend it to catch all field writes as opposed to just<br>
> reference field writes, or will it use some other form of write<br>
> barrier?<br>
<br>
It uses the G1 barrier for SATB and extends it for the preemptive<br>
copying.<br>
<br>
We don't use memory protection tricks ;-) Actually we can't, if we<br>
protecting our from-spaces, which would be a great thing to do, at least<br>
for debugging, we couldn't update the brooks pointers any more when we<br>
do the evacuation.<br>
<br>
Best regards,<br>
Roman<br>
<br>
> e.g. The Chakra JavaScript engine from Microsoft apparently uses a<br>
> write barrier implemented via memory protection trick, as noted in one<br>
> of their blog<br>
> posts: <a href="http://blogs.msdn.com/b/ie/archive/2012/06/13/advances-in-javascript-performance-in-ie10-and-windows-8.aspx" target="_blank">http://blogs.msdn.com/b/ie/archive/2012/06/13/advances-in-javascript-performance-in-ie10-and-windows-8.aspx</a><br>

><br>
><br>
> "Because Chakra’s collector works concurrently with the main script<br>
> thread, the running script may modify or create new objects on pages<br>
> that have already been processed. To make sure such objects aren’t<br>
> prematurely collected, Chakra write-protects pages before the mark<br>
> phase starts. Pages that have been written to during the mark phase<br>
> must be later rescanned on the main script thread. Because leaf<br>
> objects don’t require such processing, pages from the leaf object<br>
> space don’t need to be write-protected or rescanned later. This saves<br>
> precious time on the main script thread, reducing pauses."<br>
><br>
><br>
> Thanks,<br>
> Kris<br>
><br>
><br>
> On Fri, Jan 17, 2014 at 11:28 AM, Roman Kennke <<a href="mailto:rkennke@redhat.com">rkennke@redhat.com</a>><br>
> wrote:<br>
>         Hi there,<br>
><br>
>         Sorry being so silent... we are very happy that the Shenandoah<br>
>         JEP has<br>
>         finally been posted and would welcome any comments, questions,<br>
>         discussion from the community.<br>
><br>
>         Cheers,<br>
>         Roman<br>
><br>
>         Am Mittwoch, den 15.01.2014, 11:49 -0800 schrieb<br>
>         <a href="mailto:mark.reinhold@oracle.com">mark.reinhold@oracle.com</a>:<br>
>         > Posted: <a href="http://openjdk.java.net/jeps/189" target="_blank">http://openjdk.java.net/jeps/189</a><br>
>         ><br>
>         > - Mark<br>
><br>
><br>
><br>
><br>
><br>
<br>
<br>
</blockquote></div>