RFR: 8292916: Streamline LoaderConstraint purging [v3]

Ioi Lam iklam at openjdk.org
Thu Sep 1 17:51:07 UTC 2022


On Thu, 1 Sep 2022 12:44:39 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> The code to purge loader constraints walks through the class loader list of an unloaded class, and then asserts that the there are no leftovers. It can just directly remove the list of loaders without that walk.
>> 
>> Also I left the variable name 'probe' to help with diffs for [JDK-8291969](https://bugs.openjdk.org/browse/JDK-8291969) a little, but it's a bad variable name.
>> 
>> Tested with tier1-3 which contains jck tests.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Copy logging rather than passing name to remove_constraint.

Changes requested by iklam (Reviewer).

src/hotspot/share/classfile/loaderConstraints.cpp line 193:

> 191:       if (klass != NULL &&
> 192:           !klass->is_loader_alive()) {
> 193:         probe->set_klass(NULL);

When was this `probe` removed in the old code? I could only see this in the old code,


        if (probe->num_loaders() < 2) {
          set.remove_constraint(probe);
        }


I am wondering if the old code actually had a memory leak in this case.

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

PR: https://git.openjdk.org/jdk/pull/10023


More information about the hotspot-runtime-dev mailing list