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

To shut them down you will have to call destory() on the ThreadPoolFilter:

session.getFilterChain().get(PooledThreadModel.class.getName()).destroy();

or you create your own ThreadModel which wraps the ThreadPoolFilter in a 
ReferenceCountingIoFilter instance.

If you weren't using a ThreadPoolFilter with MINA 0.8 and you want the same 
behaviour with MINA 0.9 you must specify the ThreadModel.MANUAL thread model as 
you suggest in http://www.quickfixj.org/jira/browse/QFJ-34.

If you use the default config each connection will get its own thread pool. The 
threads in the pool (these are named AnonymousIoService-x-y by default) will by 
default be terminated after 1 minute of inactivity. If the threads do hang 
around for more than 1 minute that would be a bug. In QFJ-34 you state that the 
Anonymous... threads never die off so there may very well be a bug here.

Is there anyway you could refactor your code to use a single shared connector? 
Or use a shared ThreadPoolFilter (use MANUAL and add your own ThreadPoolFilter 
to each connectors filter chain)? I think this is more "in tune" with how MINA 
is supposed to be used.


> 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