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

Uwe Schindler uschindler at openjdk.java.net
Thu Apr 28 20:16:46 UTC 2022


On Thu, 28 Apr 2022 20:02:36 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 incrementally with one additional commit since the last revision:
> 
>   6478546: Decrease malloc'ed buffer maximum size to 64 kB

By the way: FileOutputStream has exactly the same problem with `write(byte[])`. I see no test for it, but I assume this is now also fixed. That's a longstanding issue in Lucene (this is why we use a ChunkedOutputStream when writing files.

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

PR: https://git.openjdk.java.net/jdk/pull/8235


More information about the core-libs-dev mailing list