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

Brian Burkhalter bpb at openjdk.java.net
Wed Jun 15 00:28:45 UTC 2022


On Thu, 9 Jun 2022 18:38:18 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Modify native multi-byte read-write code used by the `java.io` classes to limit the size of the allocated native buffer thereby decreasing off-heap memory footprint and increasing throughput.
>
> Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision:
> 
>  - Merge
>  - 6478546: Add break in write loop on ExceptionOccurred
>  - Merge
>  - 6478546: Clean up io_util.c
>  - Merge
>  - 6478546: Decrease malloc'ed buffer maximum size to 64 kB
>  - 6478546: FileInputStream.read() throws OutOfMemoryError when there is plenty available

This change would increase throughput at the expense of the additional complexity of a new loop in the native `readBytes()` function; a loop was already present in the native `writeBytes()` function. Putting the loop in Java was problematic and less improvement in performance was observed. I suggest at this point either refining the current proposal as needed to move it forward, or withdrawing the request and resolving the associated issue as **Will not Fix**.

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

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


More information about the core-libs-dev mailing list