RFR: 8309761: Leak class loader constraints
Zhengyu Gu
zgu at openjdk.org
Sun Jun 11 13:05:38 UTC 2023
On Sun, 11 Jun 2023 09:37:54 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
> Thanks for the reply. That's true, but I don't see how we know whether we have a dangling pointer by the end of your destructor or not either. References aren't a 100% guarantee for that either, but it is an improvement.
Reference or pointer make no difference and it has nothing to do with destructor. Consider following scenario:
There are 3 constraints in `_constraints` array, `c0`, `c1` and `c2` and there is an outstanding reference to `r` to `c1`. If there is a call to `remove_contraint(c0)`, `_constraints` array shifts to left, now `r` refers to `c2`, instead of `c1`.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14407#issuecomment-1586160705
More information about the hotspot-runtime-dev
mailing list