Understanding G1 Garbage collector

Thomas Schatzl thomas.schatzl at oracle.com
Mon Jul 6 08:44:19 UTC 2020


Hi,

On 04.07.20 13:29, Manavjeet Singh wrote:
> Greetings!
> I am currently trying to understand the source code of the G1 garbage
> collector in OpenJDK14. I learned the working of G1 from
> https://www.oracle.com/technetwork/tutorials/tutorials-1876574.html. I have
> also figured out the source code of G1 is present in
> jdk14/src/hotspot/share/gc/g1/ folder.
> Can someone please suggest where to dive into the code. I am trying to
> locate the code related to young generation marking, collection and
> evacuation phases.

   it's probably easiest to set a breakpoint in 
G1CollectedHeap::do_collection_pause_at_safepoint() and step through the 
(minor) collection on an example program.

The entry point for full heap collection is in 
G1CollectedHeap::do_full_collection().

Hth,
   Thomas


More information about the hotspot-gc-dev mailing list