write barrier and card marking

Tony Guan guanxiaohua at gmail.com
Fri Aug 13 09:28:23 PDT 2010

Hi there,

I wrote one collector of my own in hotspot, but now I have a problem.
In the new collector, I inserted another generation between the
defNewGeneration and TenuredGeneration. To collect this new
generation, I modified the defNewGeneration collector, which is gc by
copying survivors.

After the collection on this generation, I am now having an Null
pointer exception in the java program. My guess is that the collector
failed to identify the live objects in the generation. Here I need
some one to tell me if there is any missed modification on the write
barrier or card marking.

As far as I know, the write barrier works whenever a field write
happens, without regards to which generation is influenced. So this
means that the card of the written field will be marked. So my problem
should be in the closures that check if there are any live objects in
the generation. Am I right?

Or other than the card scanning, is there anything special that I
should process?

Thanks a lot!

Tony (Xiaohua Guan)

More information about the hotspot-runtime-dev mailing list