RFR: JDK-8177107: Reduce memory footprint of java.lang.reflect.Constructor/Method
Claes Redestad
redestad at openjdk.java.net
Thu Mar 3 13:58:55 UTC 2022
On Wed, 2 Mar 2022 20:28:45 GMT, Joe Darcy <darcy at openjdk.org> wrote:
> Refactoring of Method and Constructor to share a single empty array for parameters and exceptions as well as type variables.
>
> Existing core reflection regression tests pass with the change.
src/java.base/share/classes/java/lang/reflect/Executable.java line 59:
> 57:
> 58: @SuppressWarnings({"rawtypes"})
> 59: static final TypeVariable[] NO_TYPE_VARS = new TypeVariable[0];
Since you asked me offline about some startup noise from this patch I took a look. This line might be another small contributor, since it means we're loading `jlr.TypeVariable` on JVM bootstrap. It would be nice if we could move this to `TypeVariable`, but we don't support private/package-private interface fields for some reason. Shouldn't we though, now that we have private interface fields, etc..?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7667
More information about the core-libs-dev
mailing list