RFR: 8352414: JFR: JavaMonitorDeflateEvent crashes when deflated monitor object is dead [v2]

Aleksey Shipilev shade at openjdk.org
Thu Mar 20 07:06:25 UTC 2025


On Thu, 20 Mar 2025 01:21:06 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>> With regards to the event definition @egahlin suggests:
>>> It might be worth mentioning it in the field description, e.g. "If null or N/A, the object has been garbage collected", but that is all. (Null is represented as 0 in the file format, which the parser will interpret as a missing value. Both 'jfr print' and JMC will display "N/A")
>
> That is if null is used instead of dropping the event. I don't have an opinion on what is the best approach as it depends on how the event is being used.

I don't have a strong preference for either dropping event or emitting it with N/A values. I get the argument for replacing `_sync_Deflations` to count the actual deflations, so lets emit the event with N/A values then. Amended in new commit.

Unfortunately, I see no reliable way to test exactly the case for emitting the N/A event: we need to sequence monitor deflation and GC precisely to get to that point reliably. So the targeted event test just tests the always-reachable case, while the new stress test covers the corner case of dead object, among other things.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24121#discussion_r2004941954


More information about the hotspot-dev mailing list