preform GC modifications

Ofir Gordon ofirg6 at gmail.com
Thu Apr 16 12:51:45 UTC 2020


Really thanks a lot, I thinks I have all I need for now to start (:
I'll seriously consider to move to a newer jdk version if it's possible, it
sounds like it'll make my work much simpler.

‫בתאריך יום ה׳, 16 באפר׳ 2020 ב-15:29 מאת ‪Thomas Schatzl‬‏ <‪
thomas.schatzl at oracle.com‬‏>:‬

> Hi,
>
> On 16.04.20 12:28, Ofir Gordon wrote:
> > So, when it gets to those loops from - DefNewGeneration::collect() ->
> > GenCollectedHeap::gen_process_strong_roots() ->
> > SharedHeap::process_strong_roots(
> > Is it running MinorGC with mark&sweep algorithm, or MinorGC with
> > Cheney's algorithm, or maybe MajorGC?
>
>    young collection = minor gc -> uses Cheney's algo
>    old/full collection = major gc -> uses Mark-Sweep-Compact, recursive
> object graph traversal using an explicit mark stack.
>
> > I got a little confused, doesn't minor collection serial gc entering
> > point is in DefNewGeneration? does young generation collection ==  minor
> > gc or am I confusing those two?
>
> At some point you will end up in GenCollectedHeap::do_collection(); that
> method determines the type of collection (via a rather confusing
> generational framework, and forwards to either
> DefNewGeneration::collect() or TenuredGeneration::collect(), which again
> forwards to OneContigSpaceCardGeneration::collect(), forwarding to
> GenMarkSweep::invoke_at_safepoint() which at some point gets you to
> GenMarkSweep::mark_sweep_phase1() which does the "actual" marking, i.e.
> iterates over heap roots, appyling the closures on those which fill the
> mark stack that the closures then process.
>
> I.e. if you add a breakpoint in that method, you should end up there in
> case of a full/major gc.
>
> Note that "Tenured generation" is another word for what is now generally
> called "old" generation. That kind of shows how old that part of Hotspot
> code is...
>
> The other entry point I mentioned before, (Gen-)CollectedHeap::collect()
> is only used for system.gc() like calls. However at some point it also
> ends you up in GenMarkSweep::mark_sweep_phase1(). Sorry, I forgot that
> detail.. :(
>
> As already mentioned, jdk8 code is unnecessarily complex for serial gc.
> Latest tip at least does away with some of these abstractions or makes
> them easier to understand. GC is still complex code :)
>
> Thanks,
>    Thomas
>



More information about the hotspot-gc-dev mailing list