On Thu, 23 Nov 2023 11:21:12 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:
>> test/hotspot/jtreg/serviceability/jvmti/GetOwnedMonitorInfo/GetOwnedMonitorInfoTest.java >> line 61: >> >>> 59: jniMonitorEnter(obj); >>> 60: obj = null; >>> 61: System.gc(); >> >> Again one gc() is generally not sufficient. >> >> How can this test tell that the object in the monitor was actually cleared? >> I think `monitorinflation` logging may be the only way to tell. > > Yes, probably. I've been looking at the `monitorinflation` logging to very > that it gets cleared. I think it would be messy to try to get this test to > also start to parse logs. There are other tests that try to make sure that some specific object is GC'ed. If the lack of the object being collected will cause the test to fail, then look else where for a more reliable mechanism. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16783#discussion_r1406869425