RFR: 8198540: Dynalink leaks memory when generating type converters [v7]

Peter Levart plevart at openjdk.java.net
Sun Jan 10 17:20:58 UTC 2021


On Sun, 10 Jan 2021 17:01:31 GMT, Attila Szegedi <attila at openjdk.org> wrote:

>> Yes, the pre-initialized fields to Map.of() are safe regardless of whether they are volatile or not (so I would keep them non-volatile to optimize fast-path). Because the BiClassValues instance is published safely to other threads via ClassValue and because you never assign null to the fields later on.
>
> Alright, I made a new hybrid of non-volatile fields and never null fields. Hopefully we're getting to the ideal. Again, I really appreciate all the advice and direction you provided here.

Hello Attila,
This looks good to me. Just a question: How frequent are situations where the two classloaders are unrelated?

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

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


More information about the core-libs-dev mailing list