On Tue, 4 May 2021 09:05:38 GMT, Athijegannathan Sundararajan <[email protected]> wrote:
> Instead of BufferReference class, Map.Entry is used as pair implementation. > This avoids the metaspace leak seen via thread local. src/java.base/share/classes/jdk/internal/jimage/ImageBufferCache.java line 46: > 44: > 45: /* > 46: * We used to have a class BufferReference extending from > WeakReference<ByteBuffer>. I think this comment needs to be re-worded to drop "We used to have ...", "Solution is ..." and the other history. Instead it should provide a clear paragraph that explains the value of the TL for anyone reading this code. ------------- PR: https://git.openjdk.java.net/jdk/pull/3849
