RFR: 8260621: Avoid memory leak in ImageBufferCache [v2]
Jim Laskey
jlaskey at openjdk.java.net
Mon May 3 16:37:49 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.
An alternate approach is pending.
-------------
Changes requested by jlaskey (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/2307
More information about the core-libs-dev
mailing list