G1, Remembered Sets & Refinement

Yu Zhang yu.zhang at oracle.com
Mon May 11 18:46:58 UTC 2015


Simon,

I will try to answer your questions.

Thanks,
Jenny

On 5/8/2015 8:11 AM, Simone Bordet wrote:
> Hi,
>
> I would like to ask some clarification about remembered sets (RS),
> buffers and refinement in G1.
>
> My understanding is that G1 installs a write barrier to record old to
> young pointers.
> Let's assume that A is the object in old generation, and B is the
> object in young generation.
Yes.
>
> I understand that when the barrier triggers, the card correspondent to
> the place where the A resides is marked.
> This card is then enqueued into a queue (the dirty card queue).
yes
>
> I understand that until the number of entries in the dirty card queue
> does not enter the yellow zone, then nothing is done.
> When the yellow zone is entered, a refinement thread is started to
> poll items out of the dirty card queue and update the RS for the young
> region.
yes. The number of refinement threads activated is decided by 
G1ConcRefinementThresholdStep.
>
> I understand that, when a young GC happens, the refinement threads are
> stopped (if running), and "Update RS" phase takes care of processing
> the dirty card queue.
yes.
>
> Provided my understanding is correct, what is the meaning of the word
> "buffer" in this scenario ?
> PrintGCDetails prints out a "Processed Buffers" subphase for "Update
> RS", but what is a "buffer" ?
as you mentioned, the buffer is a set of the dirty card 
queues(DirtyCardQueueSet).  The dirty cards are processed by concurrent 
refinement threads or at STW phase( update RS).
>
> Another question: given that the write barrier knows exactly A's oop,
> what is the reason for card marking, rather than just recording the
> oop ?
I hope others can chime in on this.  My guess it is related to memory 
footprint and performance.
>
> Last question: would setting the yellow zone to zero always reduce the
> "Update RS" to (almost) zero ? What problem could this setting
> possibly generate ?
Probably not.  It will push more work to concurrent refinement threads, 
but still could leave some work for STW phase.
>
> Thanks !
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20150511/2c205cc0/attachment.html>


More information about the hotspot-gc-use mailing list