[master] RFR: Deflate monitors of dead objects before they become unreachable

Roman Kennke rkennke at openjdk.java.net
Tue Nov 30 13:03:19 UTC 2021


On Tue, 30 Nov 2021 10:13:21 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Well, the fix looks okay for the explanation.
> 
> But I do wonder. Is this affecting mainline too? How's Lilliput different that it encounters this bug? Should G1 even touch dead objects at all? I'd assume the object contents (including mark word) are generally garbage at that point?

I don't think it affects mainline. It only happens during refinement, and in some situations it needs to parse heap regions that contain unreachable, but not yet reclaimed, objects, using size-based traversal. In mainline this means it only needs to access the Klass* field, which is still in place, but in Lilliput this needs to access the object header, which may still point to a (already deflated) object monitor, because monitor deflation does not bother to update dead object's headers. This is what this patch fixes. I don't think that mainline ever accesses dead objects' headers.

-------------

PR: https://git.openjdk.java.net/lilliput/pull/28


More information about the lilliput-dev mailing list