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

Suchita Chaturvedi schaturvedi at openjdk.org
Thu Oct 6 19:18:26 UTC 2022


On Wed, 5 Oct 2022 20:16:36 GMT, Brice Dutheil <bdutheil at openjdk.org> wrote:

>> @Gunde @bric3 I have tried to implement all the review comments. Please re-review the PR and let me know if there is something which is still need to be corrected.
>
> @Suchitainf There's still these two comment to address in my opinion: 
> * https://github.com/openjdk/jmc/pull/419#discussion_r987769827
> * https://github.com/openjdk/jmc/pull/419#discussion_r988313757
> 
> Note I'm really unsure about the result ordering there, may be @thegreystone or @Gunde may chime in there to make sure this change is ok.

> > @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.

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

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


More information about the jmc-dev mailing list