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

Brian Burkhalter bpb at openjdk.org
Thu Sep 14 15:57:43 UTC 2023


On Thu, 14 Sep 2023 03:20:00 GMT, David Schlosnagle <duke at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8316156: Address reviewer comments
>
> src/java.base/share/classes/sun/nio/ch/ChannelInputStream.java line 49:
> 
>> 47:  */
>> 48: class ChannelInputStream extends InputStream {
>> 49:     static final int DEFAULT_BUFFER_SIZE = 8192;
> 
> Since this buffer size is now being used in more places, is it worth testing with 16KiB to match `InputStream` from https://github.com/openjdk/jdk/pull/11783?
> 
> Suggestion:
> 
>     static final int DEFAULT_BUFFER_SIZE = 16384;
> 
> 
> 
> https://github.com/openjdk/jdk/blob/11d431b2c436d6b2a0aa7a00d676a93c1b87da0e/src/java.base/share/classes/java/io/InputStream.java#L56

I can look into running a benchmark on this.

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

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


More information about the nio-dev mailing list