On Wed, 18 Nov 2026 07:11:33 GMT, Markus Grönlund <[email protected]> wrote:
>> 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. But based on that previous discussion it seems the strong link is not actually needed to keep them alive, but rather the strong link is preferred because "the main issue if the link is not STRONG is that the VM creates one classloader data per lambda as Mandy said, ". So it would seem you are going to use more C heap transiently to allow you to reclaim more C heap later. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/33921#discussion_r4610688038
