RFR: 8371718: (sc) Channels.new{Input, Output}Stream can allocate unbounded memory for a socket channel [v6]

Alan Bateman alanb at openjdk.org
Tue Dec 9 21:15:51 UTC 2025


On Tue, 9 Dec 2025 19:11:31 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Clamp read and write to 128k bytes.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8371718: Make test cleaner

src/java.base/share/classes/sun/nio/ch/ChannelOutputStream.java line 76:

> 74:             pos += n;
> 75:             rem -= n;
> 76:             bb.position(pos);

I assume this line is not needed as ch.write(bb) will advance the position by n.

test/jdk/java/nio/channels/Channels/SocketChannelStreams.java line 25:

> 23: 
> 24: /* @test
> 25:  * @bug 8279339

I suppose we add to the `@bug` line.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28705#discussion_r2604280051
PR Review Comment: https://git.openjdk.org/jdk/pull/28705#discussion_r2604286770


More information about the nio-dev mailing list