RFR: 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available [v7]

Brian Burkhalter bpb at openjdk.org
Wed Aug 3 17:14:17 UTC 2022


On Wed, 3 Aug 2022 15:42:12 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/share/classes/java/io/RandomAccessFile.java line 112:
>> 
>>> 110:         }
>>> 111: 
>>> 112:         int multiple = (len + MIN_BUFFER_SIZE - 1)/MIN_BUFFER_SIZE;
>> 
>> isn't that equivalent `(len / MIN_BUFFER_SIZE) + 1`, given that len cannot be 0 or a multiple of MIN_BUFFER_SIZE?
>
> Yes, I think you are correct. Good catch!

So changed in 9d7e4fbf39668ff3938b5f0f35d2e997ebbd9777.

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

PR: https://git.openjdk.org/jdk/pull/8235


More information about the core-libs-dev mailing list