Cache SelectorProvider is not suitable for NioServerSocketChannel
See original GitHub issueI found the issue https://github.com/netty/netty/issues/2308 saying that calling SelectorProvider#provider
for every new channel creation causes performance problems,So the SelectorProvider
is cached. But cache SelectorProvider
is not suitable for NioServerSocketChannel
, because NioServerSocketChannel
will only be created once, it will not be created many times like NioSocketChannel
, caching SelectorProvider
in NioServerSocketChannel
is instead a memory consumption.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
java.nio.channels.spi.SelectorProvider Example - Program Talk
public NioSocketChannel(SelectorProvider provider) { this(newSocket(provider)); } ... close the channel if the key is not valid anymore unsafe.close(unsafe.
Read more >SelectorProvider (Java SE 18 & JDK 18) - Oracle Help Center
A selector provider is a concrete subclass of this class that has a zero-argument constructor and implements the abstract methods specified below.
Read more >A Tour of Netty. Introduction | by Kondah Mouad | Geek Culture
This article serves as a valuable introduction to master I/O related technologies, it spans all of aspects needed to be on your way...
Read more >Java NIO - Quick Guide - Tutorialspoint
But this is not possible in case of conventional java IO as no multi ... Java NIO server socket channel is again a...
Read more >Java Examples for io.netty.channel.socket.DatagramChannel
private static DatagramChannel newSocket(SelectorProvider provider) { try ... server.channel(NioServerSocketChannel.class).group(m_tcpEventLoop).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Also an application may create multiple server channels
I agree with @johnou . Lets keep the code as it is.