On Fri, 12 Apr 2024 15:06:36 GMT, Chen Liang <li...@openjdk.org> wrote:

>> I'd prefer considering such optimizations as follow-ups. We need to think 
>> about where to define such shared classes in a way that considers the full 
>> lifecycle, facilitates class unloading (one cache per classloader?) while 
>> still getting good reuse.
>
> I think `Invokers` might be a good place. Its lifetime is bound to its MT, 
> and MT already handles class unloading well. If we are doing erased then a 
> plain array suffices.

I think we should be wary about adding things that are strongly kept alive by 
the MT. While the MTs themselves are weakly referenced and can be unloaded if 
all usage goes aways, many oft-used MTs might be kept effectively forever.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18690#discussion_r1565912250

Reply via email to