RFR: 7879: Automated Analysis taking very long time to produce results for Class Leak Rule and showing wrong results. [v5]

Suchita Chaturvedi schaturvedi at openjdk.org
Fri Dec 16 07:06:14 UTC 2022


On Fri, 7 Oct 2022 07:28:55 GMT, Brice Dutheil <bdutheil at openjdk.org> wrote:

>>> > @bric3 We need to show the names of top 5 classes which were loaded maximum times without being unloaded. So the ordering matters here. That's why I have skipped that comment.
>>> 
>>> I'm a bit confused, as in `DefaultIItemResultSet` the _insertion_ in `data` order is dependent on the iteration order of the aggregate collection, since it's a set, there's no ordering guarantees. Although I lack knowledge of the actual type and the implementation is a `TreeSet` or something alike.
>>> 
>>> https://github.com/openjdk/jmc/blob/1696e03a1fddb9cc68d32bf21a281ef24366e552/core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/util/DefaultIItemResultSet.java#L95-L99
>>> 
>>> Moreover the usage of the thread pool here will not guarantee the `add` operation will happen in the same order as the tasks have been submitted. Which leads me to think that the code should be reworked here to ensure that the results will be inserted in order.
>> 
>> I have used a synchronized block for data. After that I am getting consistent results. Without that I was getting different results every time. I mean when I was working for test JFR wldf.jfr without synchronized block on data, the top 5 results varied every time.
>
>> I have used a synchronized block for data. After that I am getting consistent results. Without that I was getting different results every time. I mean when I was working for test JFR wldf.jfr without synchronized block on data, the top 5 results varied every time.
> 
> Have you tried with an intermediate `ConcurrentLinkedQueue`, then copy the results in the data array list ?

Hi @bric3 @Gunde @aptmac , Did you get a chance to check the latest patch? Please let me know what else is required, so that we can close this PR.

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

PR: https://git.openjdk.org/jmc/pull/419


More information about the jmc-dev mailing list