Class unloading in ZGC

Liang Mao maoliang.ml at alibaba-inc.com
Sun Dec 6 15:40:22 UTC 2020


Hi ZGC team,

Previously without concurrent class unloading in ZGC, the code cache will be all treated as strong
roots. Then concurrent class unloading will only mark the nmethod of executing threads at mark start
pause and use the nmethod entry barrier to heal and also mark the oops. That sounds reasonable. But
when I looked into the concurrent marking in G1, it doesn't threat all code cache as strong roots and
of course has no nmethod entry barrier. So I'm confused why ZGC need the nmethod entry barrier for
 marking. Does the difference comes from the different algorithm of SATB vs load barrier?

Thanks,
Liang



More information about the zgc-dev mailing list