<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">czw., 11 lip 2024 o 17:33 Ron Pressler <<a href="mailto:ron.pressler@oracle.com">ron.pressler@oracle.com</a>> napisał(a):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On 11 Jul 2024, at 12:38, Michal Domagala <<a href="mailto:outsider404@gmail.com" target="_blank">outsider404@gmail.com</a>> wrote:<br>
> <br>
> PS. I JEP 444 I still see GC root paragraph:<div><br><span style="color:rgb(0,0,0);font-family:"DejaVu Sans","Bitstream Vera Sans","Luxi Sans",Verdana,Arial,Helvetica;font-size:13.3333px">> Unlike platform thread stacks, virtual thread stacks are not GC roots. Thus the references they contain are not traversed in a stop-the-world pause by garbage collectors, such as G1, that perform concurrent heap scanning.</span><br></div><div><br></div>
> What does it mean? I do not understand this paragraph. Will G1 clean VT or not?<br>
<br>> In most cases it will not because we keep a reference to the thread for observability unless you turn that off with a system property.</blockquote><div><br> <font face="arial, sans-serif">I must admit I do not undestand it.</font></div><div><font face="arial, sans-serif"><br><span style="color:rgb(0,0,0);font-size:13.3333px">"Unlike platform thread stacks, virtual thread stacks are not GC roots.</span> "<br>PT stacks are GC roots, VT stacks are not. Clear<br><br>"T<span style="color:rgb(0,0,0);font-size:13.3333px">hus the references they contain are not traversed in a stop-the-world pause by garbage collectors"<br><br></span></font></div><div><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, sans-serif">PT stack references are traversed by GC, VT stack references are not traversed. Clear.</font></span></div><div><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, sans-serif">GC starts from GC root and travers all references. Each object encountered on the road is alive, all others are abandoned. Clear.</font></span></div><div><font color="#000000" face="arial, sans-serif"><span style="font-size:13.3333px">Live references survive, abandoned are collected. Clear.</span></font></div><div><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, sans-serif">GC travers all PT references and saves live ones against collection. GC does not travers VT references. They are not marked as alive. They are treated as abandoned and collected. After the GC phase, all VT references are null. Nonsense.</font></span></div><div><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, sans-serif">Where is the mistake in my reasoning?</font></span></div><div><span style="color:rgb(0,0,0);font-size:13.3333px"><font face="arial, sans-serif"> </font></span></div></div></div></div></div></div>