On Tue, 24 Jun 2025 22:32:30 GMT, Chen Liang <[email protected]> wrote:
> Currently, fake parameters are created with "arg0" etc. strings that are > retained for class file methods with no MethodParameters attribute. The > original issue report observes many of these strings present in the heap. To > address this issue, we can remove these eagerly created fake names, bringing > their behavior in line with nameless parameters from MethodParameters > attribute, such as those from inner class constructors. A unit test verifies > that no name is retained in the Parameter object when the name is fake. > > The original report recommends using a pool to store the arg name strings. I > did not take that approach as I don't think it is very necessary; if the > issue of retained fake names persist, we can update `Parameter::getName` to > return fake names from a pool instead. This pull request has now been integrated. Changeset: f0afd89f Author: Chen Liang <[email protected]> URL: https://git.openjdk.org/jdk/commit/f0afd89f66c0b42ff06fbb76378a5b2028b76a10 Stats: 84 lines in 3 files changed: 81 ins; 0 del; 3 mod 8357728: Avoid caching synthesized names in synthesized parameters Reviewed-by: jvernee ------------- PR: https://git.openjdk.org/jdk/pull/25961
