RFR: 8319955: Improve dependencies removal during class unloading
Thomas Schatzl
tschatzl at openjdk.org
Tue Nov 14 10:32:28 UTC 2023
On Mon, 13 Nov 2023 18:52:47 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> Hi all,
>
> please review this performance improvement to dependency removal during class unloading: instead of moving the dependencies item by item via a `cmpxchg`, batch this operation.
>
> This makes that part of class unloading ~7x faster in my measurements (class unloading stress test, loading/unloading 6k classes).
>
> Testing: tier1-7
>
> Thanks,
> Thomas
Sorry forgot to answer this:
> Who/what will process the purge list and when?
There is a call to `ClassLoaderDataGraph::purge` which does that, executed later at the garbage collector's convenience. This change does not change the amount of elements (apart from the order of the elements) too, so no difference here.
(During class unloading `DependencyContext::delete_on_release()` is and has always been false, and the existing code always moves entries to the purge list - there is an appropriate assert in the new code).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16639#issuecomment-1809940071
More information about the hotspot-gc-dev
mailing list