RFR: 8299684: (bf) JNI direct buffer functions with large capacity behave unexpectedly [v9]
David Holmes
dholmes at openjdk.org
Mon Jan 16 00:42:13 UTC 2023
On Thu, 12 Jan 2023 19:44:08 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> test/jdk/java/nio/jni/NewDirectByteBuffer.java line 93:
>>
>>> 91: }
>>> 92: });
>>> 93: } catch (OutOfMemoryError ignored) {
>>
>> Why is there is catch of OOME here?
>
> Apparently it is not needed so removed in 38ea7997be2be59e2cea97c7dabf929210c0edfa.
No wonder I couldn't find this change! The catch of OOME was added because I still believe that trying to allocate a buffer of capacity Integer.MAX_VALUE will throw OOME (at least some of the time). If that happens then the test should not fail.
-------------
PR: https://git.openjdk.org/jdk/pull/11873
More information about the nio-dev
mailing list