4

All implementations of AsynchronousByteChannel in Java 8 allocate additional objects for each channel read/write operation. That looks strange for me as this API was intended (*) to be used for high performance applications and allocation of additional objects on hot execution path does not match best practices for such applications. Are there any alternative implementations that may yield good network i/O performance without allocations?

Note: One of reasons why I planned to use NIO2 is Iocp support for Windows. NIO from Java 1.4 does not use it.

* well, I don't know original intentions for this API but I assume that "normal" applications are completely satisfied with common blocking IO API and just don't need NIO/AIO.

Alexei Osipov
  • 728
  • 10
  • 17
  • 1
    I believe you can use NIO2 without the asynchronous writing using a background thread (thsi creates quite a bit of garbage). The last time i tried NIO2 I found the same, so went back to NIO. – Peter Lawrey Feb 17 '17 at 12:28

0 Answers0