RFR: 8321620: Optimize JImage decompressors
Claes Redestad
redestad at openjdk.org
Fri Dec 8 22:43:41 UTC 2023
On Mon, 20 Nov 2023 17:39:19 GMT, Glavo <duke at openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/jimage/decompressor/StringSharingDecompressor.java line 94:
>>
>>> 92: int offset, long originalSize) throws IOException {
>>> 93: if (originalSize > Integer.MAX_VALUE) {
>>> 94: throw new OutOfMemoryError("Required array size too large");
>>
>> Is this the correct exception type?
>
>> Is this the correct exception type?
>
> I'm not sure, but I think it shouldn't matter, since the exception is never really thrown here for a valid jimage file.
It's common to throw `OutOfMemoryError` when a requested array size would be too large, either due overflow or because some other limitation (see `StringUTF16::newBytesFor` or `String::replace` for some examples).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16556#discussion_r1399840037
More information about the core-libs-dev
mailing list