RFR: 8335059: Consider renaming ClassLoaderData::keep_alive

coleen.phillimore at oracle.com coleen.phillimore at oracle.com
Wed Jul 31 19:46:43 UTC 2024



On 7/31/24 3:04 PM, Stefan Karlsson wrote:
> On Wed, 31 Jul 2024 18:35:12 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>
>> How does this rename look?  Instead of ClassLoaderData::keep_alive() and a _keep_alive refcount, it's been renamed to _strongly_reachable and is_strongly_reachable().
>> Tested with tier1 on Oracle supported platforms.
> There's a risk that someone incorrectly interprets:
>
> - _strongly_reachable 0
>
>
> to mean that the class loader isn't strongly reachable.

That is what _strongly_reachable == 0 means, that the CLD isn't strongly 
reachable.  (?)

>
> In the bug entry I suggested a name `_strong_count` and tried to avoid the word "reachable" because it already have a meaning for the GC. When talking about the "strong" property we both talk about strongly reachable and strong roots. The property for this CLD is that it is a strong root from the GC's perspective. Maybe we can use that instead. What do you think about
> `_strong_root` and `is_strong_root`? Or maybe even `_root` and `is_root`?

"strong" has meaning for GC with the addition of "root" or "reachable", 
but on its own has no meaning for CLDG.  "strong" can mean a whole host 
of things.  It doesn't help me know why we're setting this flag for this 
CLD.

I want the attribute to tell me that GC can't unload this CLD!
>
> -------------
>
> PR Comment: https://git.openjdk.org/jdk/pull/20408#issuecomment-2261207888



More information about the hotspot-dev mailing list