RFR: 8147468: Allow users to bound the size of buffers cached in the per-thread buffer caches

Alan Bateman Alan.Bateman at oracle.com
Tue Jan 19 12:10:06 UTC 2016

On 15/01/2016 16:54, Tony Printezis wrote:
> (I’m starting a new thread so that it’s obvious this is a code review 
> request) Second version of this change, addressing Alan’s comments 
> (see previous e-mail exchange):
> http://cr.openjdk.java.net/~tonyp/nio-max-buffer-size/webrev.2/ 
> <http://cr.openjdk.java.net/%7Etonyp/nio-max-buffer-size/webrev.2/>
I think this mostly looks okay. I assume the property should be 
jdk.nio.maxCachedBufferSize so that the casing is consistent with other 
properties. As this will be documented/supported property then I'll need 
to get a CCC submitted.

A few comments on the test:

1. The copyright headers needs to be the pure GPL header, we don't use 
the Classpath exception on tests. Also the date is duplicated.

2. Using BufferOverflowException when filling the buffer with random 
bytes is a bit icky, it could use while buffer.hasRemaining() instead. 
Alternatively random.nextBytes(buffer.array()) should do it in one-line.

3. If you want then you could create the FileChannel directly, the 
RandomAccessFile + getChannel is not needed.

I think that's it.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20160119/78e46b5a/attachment-0001.html>

More information about the nio-dev mailing list