G1 Full GC Write Barrier Mechanism

Ofir Gordon ofirg6 at gmail.com
Sat Feb 27 16:04:30 UTC 2021


Hi all,

I'm currently working on the JDK 14 version source code.
I'm trying to understand the process of a full collection using the G1 gc.
specifically, I can't follow the write barrier mechanism--where is it being
activated? what exactly happens in the write barrier? (I see that there are
both remember set and card tables, are they both being used for tracking
changes in the heap during the collection?)

Can anyone help me understand the basic flow of this gc in the code?
I can see that the marking phase begins in
G1FullCollector::collect()->phase1_mark_live_objects(), is this part
running concurrently with the program? is the barrier being activated
beforehand? (where?)

In addition, is there a way to verify that the barrier is being executed
during the marking? which code is supposed to run for this part?

I know that this are a lot of questions, I'm just trying to figure out the
basic flow of the process so if someone can give me an explanation that
will help me start I'll be really thankful.

Thanks a lot,
Ofir



More information about the hotspot-gc-dev mailing list