[ 
http://issues.apache.org/jira/browse/DIRMINA-231?page=comments#action_12424867 
] 
            
Niklas Therning commented on DIRMINA-231:
-----------------------------------------

I did a test to see if threads are killed off after 1 minute or not. It seems 
that after running your test for 1000 cycles some of the threads created are 
killed after being inactive but there are some threads which don't. All of them 
seem to block on BlockingQueue.waitForItem(). waitForItem() blocks indefinitely 
and will only be interrupted when destroy() is called on the ThreadPoolFilter. 
I think we need to add a method which takes a timeout as well. I'll take a look 
at it. 

Please note that even if this is fixed your problem probably won't go away 
because of the default 1 minute timeout. IMO, having seperate thread pools for 
each session defeats one of the purposes of using MINA since you will end up 
with at least one thread (which should die within 1 minute of inactivity) per 
connection. I don't think this is what we want MINA users to do. If you do what 
I suggested and use a single connector or ThreadPoolFilter instance your 
problem will go away.

> SocketConnector thread leak
> ---------------------------
>
>                 Key: DIRMINA-231
>                 URL: http://issues.apache.org/jira/browse/DIRMINA-231
>             Project: Directory MINA
>          Issue Type: Bug
>    Affects Versions: 0.9.5
>         Environment: jdk1.5.0_06
>            Reporter: Brad Harvey
>         Assigned To: Niklas Therning
>            Priority: Critical
>         Attachments: ConnectionTest.java, ConnectionTest.java
>
>
> A few new threads are created for new SocketConnectors when they attempt to 
> connect to a remote host. Two of these (AnonymousIoService-x-y) are not 
> cleaned up which can eventually lead to OutOfMemoryError or other strange 
> behaviour. 
> It can be avoided by reusing SocketConnectors, but I don't think this should 
> be necessary.  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to