[External] : Re: Minor improvement to anonymous classes

Brian Goetz brian.goetz at oracle.com
Mon Aug 2 18:18:56 UTC 2021


FWIW, making this fix not only reduces the memory leak risk, but has a 
number of nice follow-on benefits that can often trigger further 
follow-on benefits:

  - fewer fields, so reduced footprint;
  - fewer fields might mean more objects fall under the scalarization 
threshold, when applicable;
  - less work in constructors;
  - shorter constructors mean more constructors fall under the inlining 
threshold;
  - more inlining might lead to other optimizations.

So it wouldn't surprise me to see macro-level effects even on programs 
without memory leaks.

> I filed https://bugs.openjdk.java.net/browse/JDK-8271623 
> <https://bugs.openjdk.java.net/browse/JDK-8271623> to track that 
> enhancement.



More information about the amber-spec-experts mailing list