RFR: 8374308: ImageBufferCache does not work as intended [v4]
David Beaumont
duke at openjdk.org
Tue Jan 6 11:27:16 UTC 2026
On Tue, 6 Jan 2026 11:03:45 GMT, David Beaumont <duke at openjdk.org> wrote:
>> Remove ineffective/unused ImageBufferCache class, and simplify callers / remove dead code.
>>
>> I removed the release methods in the internal classes, but the public ModuleReader API method is still there (the override can go away though since the default implementation also tests for non-null, so removing the override has no risk).
>>
>> I suspect there are no implementations of ModuleReader that implement release semantics after this change, so perhaps we could relax the documentation around it? Thoughts welcome.
>
> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>
> simplifying allocation and argument checks
src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java line 373:
> 371: throw new InternalError("Image file channel not open");
> 372: }
> 373: ByteBuffer buffer = ByteBuffer.allocate(checkedSize);
I changed this to just "allocate" (not "allocateDirect") after carefully reading up on direct buffers.
It's just possible this might have an observable effect (positive or negative) on either performance or memory pressure, so I'm happy to change it back if people are worried.
It's the only bit of this change that I think might not be a guaranteed no-op.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29043#discussion_r2664605202
More information about the core-libs-dev
mailing list