RFR: 7879: Automated Analysis taking very long time to produce results for Class Leak Rule and showing wrong results.
Brice Dutheil
bdutheil at openjdk.org
Wed Oct 5 11:03:36 UTC 2022
On Wed, 5 Oct 2022 10:27:42 GMT, Brice Dutheil <bdutheil at openjdk.org> wrote:
>> This PR takes care of optimizing and correcting the Class leak rule results on Automated Analysis Page.
>
> core/org.openjdk.jmc.flightrecorder.rules.jdk/src/main/java/org/openjdk/jmc/flightrecorder/rules/jdk/util/DefaultIItemResultSet.java line 128:
>
>> 126: synchronized (data) {
>> 127: data.add(row);
>> 128: }
>
> In my previous [comment](https://github.com/openjdk/jmc/pull/248/files#r633606757) on #248 I was thinking more about tweaking the collection, sorry for the lack of precision back then. So something like:
>
>
> - private final ArrayList<Object[]> data = new ArrayList<>();
> + private final List<Object[]> data = Collections.synchronizedList(new ArrayList<Object>());
>
>
> Or if the insertion order is irrelevant one might think of a `ConcurrentLinkedQueue` instead during the calculation, and copy the elements in the array list once done.
Last time I didn't thought about the order of the results, Is it something to take care, I really lack flightrecorder rule knowledge here.
-------------
PR: https://git.openjdk.org/jmc/pull/419
More information about the jmc-dev
mailing list