On Wed, 18 Nov 2026 07:09:06 GMT, David Holmes <[email protected]> wrote:

>> The resolved call site already retains the lambda implementation through its 
>> target method handle. Removing STRONG_LOADER_LINK leaves those references 
>> intact; it removes the additional requirement to retain the class for the 
>> lifetime of its defining loader.
>
> Is that specific to this usecase? I'm just wondering where the usual 
> requirement to link these to the lifetime of the defining loader comes from, 
> if they can't be used once the target method handle becomes unreachable.

See the response from Jorn, there were some previous discussions on this:

> FWIW, the suggestion to drop the STRONG link to the class loader has been 
> discussed in the past as well: 
> [#12493](https://github.com/openjdk/jdk/pull/12493)
> 
> In short: the motivation for having the strong link is that lambda classes 
> typically need the same lifetime as the enclosing class, so tying them to the 
> same class loader avoids needing additional memory for a separate class 
> loader data.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33921#discussion_r4610287008

Reply via email to