On Mon, 4 Apr 2022 09:58:35 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> As an alternative to #7667 I took a look at injecting an empty class array 
> from the VM. Turns out we already do this for exception types - see 
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/method.cpp#L918
>  - and we can do similarly for the parameter types array. We still need to 
> parse the signature for the return type, though.
> 
> I've verified by dumping and inspecting heaps that this means we are not 
> allocating extra `Class<?>[]` on `Method` reflection.

This pull request has now been integrated.

Changeset: a3851423
Author:    Claes Redestad <redes...@openjdk.org>
URL:       
https://git.openjdk.java.net/jdk/commit/a385142398eee102ff1a53d848230dc95c4ebd37
Stats:     22 lines in 4 files changed: 14 ins; 0 del; 8 mod

8177107: Reduce memory footprint of java.lang.reflect.Constructor/Method

Reviewed-by: darcy, shade, coleenp

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

PR: https://git.openjdk.java.net/jdk/pull/8089

Reply via email to