Will GC lose some locking infomation during compaction?
Y. Srinivas Ramakrishna
Y.S.Ramakrishna at Sun.COM
Wed Apr 15 10:42:21 PDT 2009
init_mark() sets the mark-word into a "prototypical" state, and this
suffices, as you surmised,
for the large majority of objects but not for all, namely for locked
objects, biased objects and
those whose hashcodes have been computed.
Recall, however, that during the marking phase the we evacuated thse
"non-prototypical" mark words into a pair of buffers. These spooled
mark-words
are used later to restore the evacuated mark words. Look for
"should_preserve_mark_word()"
or similar (I do not have a workspace handy to get you the exact name).
-- ramki
Colin(Du Li) wrote:
> Hello.
> I have two questions about GC's compaction phase.
> 1. During the compaction, after GC copies a compacted object to the its
> location, it always calls "init_mark" on this object. I think "init_mark"
> will cause the object to be "unlocked". If the object is "locked" before
> compaction, will the locking information be lost after compaction?
> 2. If the compacted object has enter a monitor (using "moniterenter"), GC
> moves it to new location, then how can GC update the monitor?
>
> Thanks a lot!
>
> Colin
>
More information about the hotspot-dev
mailing list