RFR: 8316156: (ch) Channels.newOutputStream(ch).write(bigByteArray) allocates a lot of direct memory [v3]

Alan Bateman alanb at openjdk.org
Thu Sep 14 20:12:40 UTC 2023


On Thu, 14 Sep 2023 19:35:42 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> src/java.base/share/classes/sun/nio/ch/ChannelInputStream.java line 84:
>> 
>>> 82:             rem -=n;
>>> 83:         }
>>> 84:         return nread;
>> 
>> This still looks like a "read fully", I don't think we should have a loop here.
>
> So at most `Streams.DEFAULT_BUFFER_SIZE` bytes would be read per call?

Yes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15733#discussion_r1326463728


More information about the nio-dev mailing list