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

Brian Burkhalter bpb at openjdk.org
Mon Sep 18 21:55:24 UTC 2023


On Thu, 14 Sep 2023 22:51:10 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> In `ChannelInputStream` and `ChannelOutputStream`, process small chunks of bytes in sequence to avoid running afoul of the `MaxDirectMemorySize`.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8316156: Read at most DEFAULT_BUFFER_SIZE bytes

In 7ee65b90fc6c8e48383a1f2c15626013529f6c3b the `Channel{In,Out}putStream` changes are reverted and similar changes are implemented in `transferTo` for `BufferedInputStream` and `ByteArrayInputStream`. In retrospect, I doubt that the `BufferedInputStream` changes and concomitant test code are needed.

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

PR Comment: https://git.openjdk.org/jdk/pull/15733#issuecomment-1724505673


More information about the nio-dev mailing list