On Wed, 27 Jan 2021 14:17:22 GMT, Daniel D. Daugherty <dcu...@openjdk.org> 
wrote:

>>> I thought the comments regarding the test were to use an if statement to 
>>> check iter.hasNext() and return after seeing one Monitor, rather than 
>>> keeping the while-loop and reporting every single Monitor found. The latter 
>>> seems a waste of timer as we don't know how many Monitors to expect, so it 
>>> adds no value to report them all.
>> 
>> I thought we should test whether we can get ObjectMonitor via SA at first - 
>> in other words, the test would pass when we get 1 ObjectMonitor at least.
>> However all of information of ObjectMonitors might be useful for diagnostic 
>> purposes as @dcubed-ojdk said. In this test, we use LingeredAppWithLock for 
>> debugee, so it will not waste time to iterate. (we might estimate num of 
>> locks we will observe: we can see 3 ObjectMonitors now)
>
> The number should be small. I typically see 2 or 3 depending on the java
> options. If I happen to see more, then that's a clue (to me anyway) that
> something has changed and might be amiss.

I ran this patch thru Mach5 Tier[1-3]:

- Tier1 - TestObjectMonitorIterate.java executed and passed 4 times
- Tier2 - TestObjectMonitorIterate.java does not execute in Tier2
- Tier3 - TestObjectMonitorIterate.java executed and passed 13 times

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

PR: https://git.openjdk.java.net/jdk/pull/1910

Reply via email to