I think the interesting thing is not the thread count. Its the count of th active threads...<br><br>bye<br>norman<br><br>Am Donnerstag, 6. Oktober 2011 schrieb irwinbilling <<a href="mailto:irwin.billing@gmail.com">irwin.billing@gmail.com</a>>:<br>
> Terrible mistake. I had a loose connection to the database for every client<br>> that wasn't getting closed. The problem seems to have disappeared.<br>> Although, threads continue to be made. I tried connecting clients until the<br>
> thread count reached 90 (the connections were all closed explicitly). Is<br>> this normal behavior?<br>><br>> Thanks,<br>> Irwin<br>><br>><br>> Norman Maurer-2 wrote:<br>>><br>>> Are you 100 % sure you are not calling it ? With a database lookup in<br>
>> place you will need to use an ExecutionHandler to offload the task as<br>>> otherwise you will block your IO-Thread.<br>>><br>>> Maybe you could also attach an thread-dump (via jstack) and show use<br>
>> how your ChannelPipelineFactory implementations looks like.<br>>><br>>> Bye,<br>>> Norman<br>>><br>>><br>>> 2011/10/5 irwinbilling &lt;irwin.billing@&gt;:<br>>>> The handleUserSearch method performs a simple database search and writes<br>
>>> the<br>>>> result to the given channel. I do not call the method during my tests.<br>>>> I<br>>>> only call logout.<br>>>><br>>>><br>>>> Norman Maurer-2 wrote:<br>
>>>><br>>>>> What does handleUserSearch((MessageUserSearch) message, channel); do ?<br>>>>><br>>>>> 2011/10/4 irwinbilling &lt;irwin.billing@&gt;:<br>>>>>> Code:<br>
>>>>> public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)<br>>>>>> {<br>>>>>><br>>>>>> Message message_new = (Message) e.getMessage();<br>
>>>>><br>>>>>> if (message instanceof MessageLogout) {<br>>>>>> logout((MessageLogout) message);<br>>>>>> } else if (message instanceof MessageUserSearch) {<br>
>>>>> handleUserSearch((MessageUserSearch) message,<br>>>>>> channel);<br>>>>>> }<br>>>>>><br>>>>>> super.handleMessage(message, channel);<br>
>>>>> }<br>>>>>> public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent<br>>>>>> e)<br>>>>>> throws Exception {<br>
>>>>> if (channel != null) {<br>>>>>> channel.getCloseFuture().removeListener(remover);<br>>>>>><br>>>>>> channel.close();<br>
>>>>> }<br>>>>>> super.channelClosed(ctx, e);<br>>>>>> }<br>>>>>><br>>>>>><br>>>>>> "channel" is a cached Channel for this connection. Could holding onto<br>
>>>>> a<br>>>>>> channel reference be causing this.<br>>>>>><br>>>>>> 2011/10/4 irwinbilling &lt;irwin.billing@&gt;:<br>>>>>>> Hello,<br>
>>>>>><br>>>>>>> I seem to be running into a very peculiar problem. Using the default<br>>>>>>> ChannelFactory (Executors.newCachedThreadPool()) with a custom<br>>>>>>> ChannelPipeline, the server seems to stop serving new connections<br>
>>>>>> after<br>>>>>>> 39<br>>>>>>> successful connections and message exchanges.<br>>>>>>><br>>>>>>> When looking at the list of running threads, it seems that for every<br>
>>>>>> new<br>>>>>>> connection, a new thread is started. When the channel disconnects,<br>>>>>>> the<br>>>>>>> thread stays alive (waiting at Unsafe.park). This happens until the<br>
>>>>>> 40th<br>>>>>>> connection when the CHannelFactory.getPipeline() does not get called.<br>>>>>>><br>>>>>>> What could cause an issue of this sort?<br>
>>>>>><br>>>>>>> Thanks!<br>>>>>>><br>>>>>>> --<br>>>>>>> View this message in context:<br>>>>>>> <a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Threads-New-Connections-tp6859861p6859861.html">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Threads-New-Connections-tp6859861p6859861.html</a><br>
>>>>>> Sent from the Netty User Group mailing list archive at Nabble.com.<br>>>>>>> _______________________________________________<br>>>>>>> netty-users mailing list<br>
>>>>>> netty-users@.jboss<br>>>>>>> <a href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>>>>>>><br>
>>>>><br>>>>>> _______________________________________________<br>>>>>> netty-users mailing list<br>>>>>> netty-users@.jboss<View this message in context: <a href="http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Threads-New-Connections-tp6859861p6867246.html">http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Threads-New-Connections-tp6859861p6867246.html</a><br>
> Sent from the Netty User Group mailing list archive at Nabble.com.<br>><br>> _______________________________________________<br>> netty-users mailing list<br>> <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a>