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

Alan Bateman alanb at openjdk.org
Tue Sep 19 07:44:40 UTC 2023


On Mon, 18 Sep 2023 21:55:21 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: Revert Channel*Stream changes; add BAIS changes; replace test

Changing BAIS and BIS is good as it avoids the behavioural change that CIS.read may do a short read. The updates look okay but I think we'll need to expand the test for BIS.transferTo for cases where the BIS is created with a buffer size > 128k. Confining the change to just BAIS and not touching BIS is okay too.

One other thing is that the JBS issue and PR title/description are now out of date so probably should fix those up to avoid any confusion.

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

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


More information about the nio-dev mailing list