[ 
https://issues.apache.org/activemq/browse/AMQ-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39078
 ] 

anish pathadan commented on AMQ-1214:
-------------------------------------

Hi All,
      This bug can be closed as the threads persisted are valid.

If we run the original test case(ie threadleaker.tar.gz), we can see the 
threads which persisted are two "ActiveMQ Scheduler" threads. These threads are 
executed using ScheduledThreadPoolExecutor with a pool size of 5. Pool size of 
5 means a maximum of 5 such threads will be available in the pool and these 
threads will be used to execute n number of "ActiveMQ Scheduler" threads. 

If connection is created and closed a lot of times, a maximum of 5 "ActiveMQ 
Scheduler" threads and  lots of "ActiveMQ Connection worker"  threads will be 
created.The latter  thread is created to be timed out after 5 seconds of 
creation.

This can be verified by executing the attached test.java . This testcase prints 
the total number of threads in the system after a  connection.start() and 
connection.close() is called.The total  number of threads never increases to a 
very high number  as the initial threads are getting timed out. 

Thanks,
Anish

> threads not stopping causing memory leaks which can lead to OutOfMemoryError
> ----------------------------------------------------------------------------
>
>                 Key: AMQ-1214
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1214
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>         Environment: Fedora Core 6
>            Reporter: Xavier Toth
>         Attachments: test.java, threadleak.tar.gz
>
>
> Threads started by ActiveMQ on behalf of a client persist in a ThreadGroup 
> despite calling the 'interrupt' method on the group thereby leaking memory.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to