RFR: 8147468: Allow users to bound the size of buffers cached in the per-thread buffer caches
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):
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...
More information about the nio-dev