RFR: 8260621: Avoid memory leak in ImageBufferCache [v2]

Alan Bateman alanb at openjdk.java.net
Mon Jun 28 07:07:08 UTC 2021


On Wed, 3 Feb 2021 01:29:02 GMT, Bo Zhang <github.com+12689835+blindpirate at openjdk.org> wrote:

>> Previously, `ImageBufferCache` contains a ThreadLocal field which holds
>> strong reference to `ImageBufferCache$BufferReference.class`. When loaded
>> from `jrt-fs.jar`, this will keep `JrtFileSystemProvider$JrtFsLoader`
>> in memory forever and never being GCed.
>> 
>> The fix replace the old `ImageBufferCache$BufferReference` class with
>> `WeakReference<ByteBuffer>`, which is verified by provided test.
>
> Bo Zhang has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR.

This issue was fixed with PR 3849 so I assume PR 2307 can be closed.

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

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


More information about the core-libs-dev mailing list