That's pretty simple. In Linux set the file descriptor limit to something small 
like 500. Then try to open 1000 connections remotely.   It spins out of control 
because accept() fails due to lack of FDs. My code sleeps the acceptor thread 
when that happens.  This behavior has nothing to do with Java and is a function 
of the underlying OS. 

Sent from my iPhone

> On Jun 10, 2016, at 9:41 AM, Emmanuel Lécharny <elecha...@gmail.com> wrote:
> 
>> Le 10/06/16 à 13:49, Jonathan Valliere a écrit :
>> I've been working with NIO directly for many years and I haven't seen this 
>> issue in a very long time. The selector will spin out of control if there 
>> are no more file descriptors but that's not the fault of NIO. 
>> 
>> What OS is the issue appearing on?  What version of Java?
> 
> This has been seen on various OS, and various Java version. Check
> http://bugs.java.com/view_bug.do?bug_id=6403933.
> 
> If the underlying JVM is not anymore impacted by this problem, then the
> existing code will never be a problem.
> 
> Now, if you can show us some code that makes teh selector spin out of
> control, due to the lack of file descriptors, I would be pleased to test
> it and take care of this specific use case.
> 

Reply via email to