hotspot cms root?

Robin Wong robinwonguw at gmail.com
Fri Jan 30 05:30:21 UTC 2015


Hi,

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.

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

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?

I'm not sure whether this is the right place to post. If not, please
forward to the right place.

Thanks,
Robin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20150129/363f8699/attachment.htm>


More information about the hotspot-gc-dev mailing list