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

Alan Bateman alanb at openjdk.java.net
Thu Apr 14 06:27:05 UTC 2022


On Thu, 14 Apr 2022 01:40:50 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.

src/java.base/share/native/libjava/io_util.c line 133:

> 131:             if (nread == 0)
> 132:                 nread = -1;
> 133:             break;

Can you prototype doing the loop in Java rather than in native code so that there is less native code to maintain?

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

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


More information about the core-libs-dev mailing list