preform GC modifications

Ofir Gordon ofirg6 at gmail.com
Thu Apr 16 10:28:55 UTC 2020


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?
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?

Thanks,
Ofir

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

> Hi,
>
> On 16.04.20 10:49, Ofir Gordon wrote:
> > Thank you very much for the detailed answer.
> > I'll take your recomendation to try and use a newer version, it just
> > that I'm working on a specific simulator which might have difficulties
> > with newer jdk versions, but it worth a try.
> >
> > If it is ok I would like another followup question, regarding the actual
> > method in which the marking phase is preformed (again for the serial gc)
> > - when I follow after the calls from GenCollectedHeap::collect(), I can
> > see that finaly it gets in a method
> > GenCollectedHeap::gen_process_strong_roots(), where I believe the actual
> > marking happens? then inside the method it goes to
> > SharedHeap::process_strong_roots, and in there, there are many oops_do()
> > calls of different classes.
> > So my question is, where exactly the marking loop happens for this case?
> > and how can it be specified for different types of gc (cause not all go
> > the same code paths...)
>
> Probably you are looking at Serial GC minor collections which are called
> in that path, but you are interested in major collections which applies
> the Mark-Sweep-Compact algorithm that is executed only once in a while
> (i.e. when old gen is full).
>
> The entry point you are looking for where marking is happening would be
> GenMarkSweep::mark_sweep_phase1().
>
> The actual marking "loop" in Serial GC major gc is done using a
> recursion using an explicit (mark) stack (MarkSweep::_marking_stack and
> _objarray_stack) by calling MarkSweep::follow_stack() in
> MarkSweep::follow_root() which is called by these oops_do() methods you
> already found.
>
> Minor gc uses Cheney's two-finger technique.
>
> Thanks,
>    Thomas
>



More information about the hotspot-gc-dev mailing list