RFR: 8309761: Leak class loader constraints
Johan Sjölen
jsjolen at openjdk.org
Sat Jun 10 12:01:41 UTC 2023
On Sat, 10 Jun 2023 02:29:55 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
> Please review this patch to avoid leaking class loader constraints.
Hi,
Yes, this fixes the bug, but I'm confused.
If `ConstraintSet` determines the lifetime of the `LoaderConstraint`s, then why isn't the type of `_constraints` `GrowableArray<LoaderConstraint>*`? `loaderConstraints.cpp:161` is the only place where we create `LoaderConstraint`s on the heap and also the only place where we call `add_constraint()`. I'd rather see that change, than adding code onto the destructor. Is there some reason that this can't be done?
Cheers,
Johan
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14407#issuecomment-1585633692
More information about the hotspot-runtime-dev
mailing list