<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I have some knowledge about JVM but I'm still new to hotspot. Recently I started reading cms code in jdk-8 but I got some questions. The first question I have is about how scan/mark root really works. In Initial mark phase, I went through the code path along CMSParInitialMarkTask::work() > CMSParMarkTask::work_on_young_gen_roots() > CMSParMarkTask::do_young_space_rescan() > ContiguousSpace::par_oop_iterate() > oopDesc::oop_iterate() > ... > Par_MarkRefsIntoClosure::do_oop(). It seems to me the gc thread would simply iterate each address slot in young generation here (edan space, from space, to space), as seen from ContiguousSpace::par_oop_iterate(), and when the address points to an address in cms, mark that address in cms (_span.contains(addr) in Par_MarkRefsIntoClosure::do_oop()) if I'm right interpreting _span as part of cms space.<br><br></div>From what I know about JVM root, it should include stack, static slots and registers, and when gc starts, the thread should scan from the root and then objects transitively reachable from the root, and mark them. But here in hotspot, I couldn't figure out how JVM root is involved.<br><br></div><div>BTW, I find simply reading hotspot code is not very easy, so I wonder if some one can tell me where I can get the technical reports or other sources regarding GC implementation inside hotspot if possible?<br></div><div><br></div>I'm not sure whether this is the right place to post. If not, please forward to the right place.<br><br></div>Thanks,<br></div>Robin<br></div>