RFR: 8292916: Streamline LoaderConstraint purging [v3]
Coleen Phillimore
coleenp at openjdk.org
Thu Sep 1 18:13:25 UTC 2022
On Thu, 1 Sep 2022 17:41:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> 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.
>
> 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.
That's when the probe was removed in the old code, the code was reached unconditionally whether klass is alive or not. If it wasn't removed, we do assert that klass is alive. I was trying to figure out why 2, but if the constraint wasn't between at least two loaders (if the rest of the loaders are unloaded, you might still have bootstrap remaining, which is never removed), it should be removed.
-------------
PR: https://git.openjdk.org/jdk/pull/10023
More information about the hotspot-runtime-dev
mailing list