You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "John Miller (JIRA)" <ji...@apache.org> on 2011/08/14 22:18:27 UTC

[jira] [Created] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
-------------------------------------------------------------------

                 Key: AMQ-3451
                 URL: https://issues.apache.org/jira/browse/AMQ-3451
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
    Affects Versions: 5.5.0
         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
Tomcat 6.0.32
Spring 3.0.5

            Reporter: John Miller


Every time when restarting web application in Tomcat Manager I get messages:

SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.

With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.

I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "ravi bhatt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104532#comment-13104532 ] 

ravi bhatt commented on AMQ-3451:
---------------------------------

and BTW i have tested this on tomcat 5, 6 and 7 with activemq 5.5.0



> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved AMQ-3451.
------------------------------

       Resolution: Fixed
    Fix Version/s: 5.7.0

I created AMQ-4033 for the issue with the embedded AMQ broker. The JMS client now shutdown all the threads, and can be unloaded by the classloader etc.

About the AMQ 5.7 release, then this should be discussed at the AMQ mailing list such as either the dev or user.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>             Fix For: 5.7.0
>
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428097#comment-13428097 ] 

liny commented on AMQ-3451:
---------------------------

Hi,

Is the solution is one of bellows?
1. Killed all sessions, wait more than 30 secs, then thread pool will kill himself.
2. Use patch.txt

                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416089#comment-13416089 ] 

liny commented on AMQ-3451:
---------------------------

@Gary 
Thanks for reply. Directly call below method in my stop() still can't work.
<raw>
((PooledConnectionFactory) springHelper.getBean("pooledJmsFactory")).stop();
</raw>
Please refer to http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654084.html for details.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "John Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Miller closed AMQ-3451.
----------------------------


Duplicate

> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "nimmi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453845#comment-13453845 ] 

nimmi commented on AMQ-3451:
----------------------------

ok,thank you.Will mail the user mailing list.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>             Fix For: 5.7.0
>
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450546#comment-13450546 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

Okay got the JMS client leak fixed and committed to trunk. No leaks reported by Tomcat, and the WebappClassLoader did not have any strong references to any classes anymore. So seems we can fully undeploy/redeploy without leaks now.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey updated AMQ-3451:
------------------------

    Attachment: transport_thread_leak.png

Attached a screenshot with profiler which clearly shows a memory leak.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427617#comment-13427617 ] 

Sergey commented on AMQ-3451:
-----------------------------

The problem is that when you put ActiveMQ libraries into Tomcat shared "lib" folder, then ActiveMQ  thread pool becomes shared between all web applications. When a web application sends a message, then a transport thread is created by a web application, then the thread is returned to the pool. Then the web application is undeployed,  the thread remains alive in the pool and can be re-used by another applicaiton. In results into a memory leak, because the thread is still alive after undeployment of web application and references the web application context classloader.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447575#comment-13447575 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

Okay got as far with a JMS client in Tomcat now not reporting any leaks from its console, when I stop the app or redeploy it.
> 
Message: 	
No web applications appear to have triggered a memory leak on stop, reload or undeploy.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker2.patch, AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "nimmi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446121#comment-13446121 ] 

nimmi commented on AMQ-3451:
----------------------------

When can we expect a solution to this issue ? We are facing the same issue on Tomcat7 as well.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448865#comment-13448865 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

First part of patch is committed to the code base. The connector/transport code need a bit more love, as they tend to either create the pools in ctr / start or stop lifecycle methods. The code could possible be more consistent among them.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415845#comment-13415845 ] 

liny commented on AMQ-3451:
---------------------------

I crated a war to reproduce this issue. Please refer to http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654028.html. Hope this is helpful.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447576#comment-13447576 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

With an embedded AMQ broker I still get this

> The following web applications were stopped (reloaded, undeployed), but their
classes from previous runs are still loaded in memory, thus causing a memory
leak (use a profiler to confirm):
/camel-example-activemq-tomcat
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker2.patch, AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "nimmi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447251#comment-13447251 ] 

nimmi commented on AMQ-3451:
----------------------------

Hello Claus,

Would it be possible to attach the updated ActiveMQ jar please.Also let me know which version of ActiveMQ are you using.
I am trying the 5.7.snapshot since it has the new DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown(); method but still Tomcat7 fails to shutdown cleanly.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated AMQ-3451:
-----------------------------

    Attachment: AMQ-3451-broker.patch

I have attached a patch to fix the part that is used by the broker, to use the executor the broker itself provides.

Anyone see a problem with that? The unit tests passes, and a brief spin of running a standalone broker seems fine.


                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claudio Corsi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13430390#comment-13430390 ] 

Claudio Corsi commented on AMQ-3451:
------------------------------------

@Sergey

The issue is more fundamental than your patch.  Those threads are created by the default task runner factory and this factory is created once and then never shutdown throwout the life time of the process. 

Adding a shutdown of the default task runner will remove this issue but will raise another issue when using the shared classloader of the application server with multiple containers.

The default task runner should be associated with the broker server and not a self contained static class.  This should resolve the case of its use within the broker side code but will not resolve this issue within the client side issue.  That needs a little more work on getting this to work properly.

I have tried to shutdown the default task runner factory fix but when I hot deploy the container again.  It raises a rejected exception when trying to add a task to the runner since this executor has been shutdown already.

I tried a fix to associates a default task runner factory to the broker and that resolved the issue I was initially seeing.

I still have an issue with the client code that uses the default task runner factory.  This still needs work on my end and will probably require a different fix that would provide a similar solution.  I was thinking about using WeakReferences associated with a ReferenceQueue.  Whenever the remove method is called the task runner factory can be shutdown.  This might work.  I just need to implement this.

--Claudio

                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Andreas Hartmann (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170863#comment-13170863 ] 

Andreas Hartmann edited comment on AMQ-3451 at 12/16/11 9:41 AM:
-----------------------------------------------------------------

For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

----

Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }
----

Shutdown the task runner factory in a servlet context listener:

----

public class CleanupAmqThreads implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
    }
}

                
      was (Author: andreas@apache.org):
    For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

bq. Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }

Shutdown the task runner factory in a servlet context listener:

bq. public class CleanupAmqThreads implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
    }
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
    }
}

                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427872#comment-13427872 ] 

Sergey commented on AMQ-3451:
-----------------------------

The problem is in org.apache.activemq.thread.TaskRunnerFactory#executor. The thread pool's keepAliveTime is 30 seconds. If you have a single web application in Tomcat which uses JMS, and
 you re-start (or re-deploy) your web application in an interval less that 30 seconds, then the thread is not terminated and re-used, the thread references the undeployed web applicaiton classloader and JVM cannot collect undeployed application and free PermGen memory area.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428114#comment-13428114 ] 

Sergey commented on AMQ-3451:
-----------------------------

If ActiveMQ libraries are in tomcat shared libs, then you cannot kill the thread pool.
The thread pool (I mean org.apache.activemq.thread.DefaultThreadPools#DEFAULT_TASK_RUNNER_FACTORY) is shared between multiple web applications, so you can't kill it because it will affect other web applicaitons, all of them will be unable to use JMS
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13413543#comment-13413543 ] 

liny commented on AMQ-3451:
---------------------------

I have same issue after stop my application by Tomcat.
I don't know why ActiveMQ team doesn't fix it for a long time.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Andreas Hartmann (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170863#comment-13170863 ] 

Andreas Hartmann commented on AMQ-3451:
---------------------------------------

For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

bq. Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }

Shutdown the task runner factory in a servlet context listener:

bq. public class CleanupAmqThreads implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
    }

}

                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428000#comment-13428000 ] 

Sergey edited comment on AMQ-3451 at 8/3/12 11:35 AM:
------------------------------------------------------

Found another memory leak, see AMQ-3959
                
      was (Author: sgri):
    Found another memory leak.
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428126#comment-13428126 ] 

Sergey edited comment on AMQ-3451 at 8/3/12 2:35 PM:
-----------------------------------------------------

@liny

I you didn't put ActiveMQ lib in tomcat shared lib, then I don't understand why you have a memory leak, because when I package ActiveMQ libs to WEB-INF/lib, then I don't have any memory leaks except AMQ-3959. 
You need to deploy your web application, then stop it in Tomcat Manager, then use Eclipse Memory Analysis tool, take a heap dump, open histogram, group by clasloader, then find paths to GC root for WebAppClassLoader. When done, you will know for sure the cause of  the memory leak.
                
      was (Author: sgri):
    I you didn't put ActiveMQ lib in tomcat shared lib, then I don't understand why you have a memory leak, because when I package ActiveMQ libs to WEB-INF/lib, then I don't have any memory leaks except AMQ-3959. 
You need to deploy your web application, then stop it in Tomcat Manager, then use Eclipse Memory Analysis tool, take a heap dump, open histogram, group by clasloader, then find paths to GC root for WebAppClassLoader. When done, you will know for sure the cause of  the memory leak.
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450678#comment-13450678 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

Okay got further on the embedded broker side. Got a classloader leak fixed due a spring introspection cache, needed to be explicit cleared.
The tomcat manager console now says there is no leaks. And all activemq and camel classes is fully unloaded when stopping the app.

One last thing would be a JMX thread not being shutdown on the broker side.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Nils-Helge Garli (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13184829#comment-13184829 ] 

Nils-Helge Garli commented on AMQ-3451:
---------------------------------------

Same problem, using Active MQ 5.5.1. Tried with "closeAsync=false" which didn't seem to make any difference.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416044#comment-13416044 ] 

Gary Tully commented on AMQ-3451:
---------------------------------

@liny, thanks for that test case war. Peeking at the code, I think the problem is related to the code in com.foo.MainApplication#stop

That closes the connection, (returns them to the pool), but does not stop the connection pool. It does however stop the executors, and this prevents the real close of the connections when the spring context calls the custom stop destroy method. This is evident from the {{ERROR o.a.a.transport.tcp.TcpTransport - Could not stop service: tcp://foo.com/15.87.14.93:61616. Reason: java.util.concurrent.RejectedExecutionException}} exception.

So you can explicitly call close on the connection pool, like:
{code}conn.close();
((PooledConnectionFactory) springHelper.getBean("pooledJmsFactory")).stop();
DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
DefaultThreadPools.shutdown();{code}
or somehow arrange it such that the calls to {{shutdown()}} are done when the spring context is destroyed. So after the connection pool is successfully destroyed.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "nimmi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450843#comment-13450843 ] 

nimmi commented on AMQ-3451:
----------------------------

We tried the 6th September build and our issues with ActiveMQ task runner threads have been fixed.Thank you.
When can we expect the official version of ActiveMQ-5.7 to be released ?
Also could anybody please comment on AMQ-4030.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Guilhem RAMBAL (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13268345#comment-13268345 ] 

Guilhem RAMBAL commented on AMQ-3451:
-------------------------------------

Hello,

Have you got a workaround to solve this issue ?

Sincerely
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428012#comment-13428012 ] 

Sergey edited comment on AMQ-3451 at 8/3/12 12:01 PM:
------------------------------------------------------

@Gary

Ok, I will try to set tccl to null and then will run the memory profiler again.
                
      was (Author: sgri):
    @Gary

Ok, I will try to set tccl to null and the run the memory profiler again.
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427643#comment-13427643 ] 

Sergey commented on AMQ-3451:
-----------------------------

Whether you have a memory leak or not depends on how fast you re-load or re-deploy applications and how intense ActiveMQ is used by other web applications on the same tomcat. Sometimes "ActiveMQ Transport" or "ActiveMQ Task" thread is terminated by inactivity, and in that case you don't have a memory leak. Most of the time you have a memory leak when deploying ActiveMQ to Tomcat shared libs.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Dejan Bosanac (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13172356#comment-13172356 ] 

Dejan Bosanac commented on AMQ-3451:
------------------------------------

Looked at some similar issue, and it seems to me it's just Tomcat doesn't like threads created for async closing of activemq connections. Try using URLs like

{code}failover:(tcp://localhost:61616?closeAsync=false){code}

and see if it helps.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned AMQ-3451:
--------------------------------

    Assignee: Claus Ibsen
    
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "John Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Miller resolved AMQ-3451.
------------------------------

    Resolution: Duplicate

Duplicate of https://issues.apache.org/jira/browse/AMQ-2852

> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427981#comment-13427981 ] 

Sergey commented on AMQ-3451:
-----------------------------

@Gary

Yes, I understand the nature of the reference. When ActiveMQ thread pool creates a new thread, then the thread inherits the current thread context classloder. When the client web application is creating a JMS connection, then the context classloder is Tomcat WebAppClassLoader. As long as the thread is alive, it references web application classloader. The thread can be re-used by another web application while still holding a reference to the undeployed web application which created the thread.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428012#comment-13428012 ] 

Sergey commented on AMQ-3451:
-----------------------------

@Gary

Ok, I will try to set tccl to null and the run the memory profiler again.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427629#comment-13427629 ] 

Sergey commented on AMQ-3451:
-----------------------------

However, when I removed ActiveMQ libraries from tomcat shared libraries and packaged them into WAR, the problem has gone because each web application now has its own ActiveMQ thread pool.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13095327#comment-13095327 ] 

Gary Tully commented on AMQ-3451:
---------------------------------

does calling: org.apache.activemq.thread.DefaultThreadPools#shutdown work for you? I guess it would need to be part of a javax.servlet.ServletContextListener or called as part of the shutdown of your message listener container.
I guess we would need to include a little helper class to make it easier to configure.

> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428118#comment-13428118 ] 

liny commented on AMQ-3451:
---------------------------

@Sergey

No, I didn't put ActiveMQ Lib in tomcat share lib directory. So your solutions work, right? If yes, really appreciated. I'll try soon!
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428020#comment-13428020 ] 

Sergey edited comment on AMQ-3451 at 8/3/12 12:15 PM:
------------------------------------------------------

I have tried the patch below
-------------------------
Index: activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java       (revision 1366667)
+++ activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java       (working copy)
@@ -108,6 +108,8 @@
                 Thread thread = new Thread(runnable, name + "-" + id.incrementAndGet());
                 thread.setDaemon(daemon);
                 thread.setPriority(priority);
+                thread.setContextClassLoader(null);
                 return thread;
             }
         });
-------------------------

Still have memory leak, now because of inherited access control context, see the screenshot.


                
      was (Author: sgri):
    I have tried the patch below
-------------------------
Index: activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java       (revision 1366667)
+++ activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java       (working copy)
@@ -108,6 +108,8 @@
                 Thread thread = new Thread(runnable, name + "-" + id.incrementAndGet());
                 thread.setDaemon(daemon);
                 thread.setPriority(priority);
+                thread.setContextClassLoader(null);
                 return thread;
             }
         });
-------------------------

Still have memory leak, now because of inherited access control context.


                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447262#comment-13447262 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

The ASF CI server will once in a while deploy a new SNAPSHOT you can download. Keep an eye on
https://builds.apache.org/job/ActiveMQ-Trunk-Deploy/

The attached patch only fixes on the broker side, there is still all the transports. I am continuing on the patch, taking one step at a time. Currently testing with 2 more fixes for discover agent and another place. Then next is the remainder 7 transports using it.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427938#comment-13427938 ] 

Gary Tully commented on AMQ-3451:
---------------------------------

@Sergey this is great information

So the crux seems to be the classloader reference, if the pool is to be shared then it must not refer to an app specific loader. Do you understand the nature of that reference?

The alternative approach is to remove the use of the statically defined default task runner factory from client side code and use one per connection factory.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447726#comment-13447726 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

I discovered a leak in Camel, when JMX is enabled. 
https://issues.apache.org/jira/browse/CAMEL-5564
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated AMQ-3451:
-----------------------------

    Attachment: AMQ-3451-broker2.patch

Patch with more fixes. Only the transports to go now.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker2.patch, AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428167#comment-13428167 ] 

Sergey commented on AMQ-3451:
-----------------------------

@liny

I tried to download the application from https://docs.google.com/open?id=0B-ZFcczN9qxYZmh5dDdoMFVCUkE, and analyzed the heap dump.

I don't see any memory leaks related to threads, the only memory leak with your web application is  AMQ-3959
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428126#comment-13428126 ] 

Sergey commented on AMQ-3451:
-----------------------------

I you didn't put ActiveMQ lib in tomcat shared lib, then I don't understand why you have a memory leak, because when I package ActiveMQ libs to WEB-INF/lib, then I don't have any memory leaks except AMQ-3959. 
You need to deploy your web application, then stop it in Tomcat Manager, then use Eclipse Memory Analysis tool, take a heap dump, open histogram, group by clasloader, then find paths to GC root for WebAppClassLoader. When done, you will know for sure the cause of  the memory leak.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Andreas Hartmann (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170863#comment-13170863 ] 

Andreas Hartmann edited comment on AMQ-3451 at 12/16/11 9:39 AM:
-----------------------------------------------------------------

For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

bq. Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }

Shutdown the task runner factory in a servlet context listener:

bq. public class CleanupAmqThreads implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
    }
    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
    }
}

                
      was (Author: andreas@apache.org):
    For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

bq. Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }

Shutdown the task runner factory in a servlet context listener:

bq. public class CleanupAmqThreads implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
    }

}

                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "MBakhti (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13138391#comment-13138391 ] 

MBakhti commented on AMQ-3451:
------------------------------

I have the same issue in Activemq 5.5. 
I tried :
 
broker.getTaskRunnerFactory().shutdown();
broker.getPersistenceTaskRunnerFactory().shutdown();
broker.stop();
broker.waitUntilStopped();
Scheduler.shutdown();

but it doesn't change anything 

                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416089#comment-13416089 ] 

liny edited comment on AMQ-3451 at 7/17/12 11:11 AM:
-----------------------------------------------------

@Gary 
Thanks for reply. Directly call below method in my stop() still can't work.
{quote}
((PooledConnectionFactory) springHelper.getBean("pooledJmsFactory")).stop();
{quote}
Please refer to http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654084.html for details.
                
      was (Author: liny):
    @Gary 
Thanks for reply. Directly call below method in my stop() still can't work.
<raw>
((PooledConnectionFactory) springHelper.getBean("pooledJmsFactory")).stop();
</raw>
Please refer to http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654084.html for details.
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Javier Molina (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128557#comment-13128557 ] 

Javier Molina commented on AMQ-3451:
------------------------------------

In my case the message appears regardless of the queue(s) being empty.

Using activemq 5.5 with camel 2.8 and spring 3.0.5 deployed to tomcat 6.0.32

Broker is set up locally using activemq camel component.


                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13416089#comment-13416089 ] 

liny edited comment on AMQ-3451 at 7/17/12 11:13 AM:
-----------------------------------------------------

@Gary 
Thanks for reply. Directly call below method in my stop() still can't work.
{noformat}
((PooledConnectionFactory) springHelper.getBean("pooledJmsFactory")).stop();
{noformat}
Please refer to http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654084.html for details.
                
      was (Author: liny):
    @Gary 
Thanks for reply. Directly call below method in my stop() still can't work.
{quote}
((PooledConnectionFactory) springHelper.getBean("pooledJmsFactory")).stop();
{quote}
Please refer to http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654084.html for details.
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey updated AMQ-3451:
------------------------

    Attachment: inherited_access_cotrol_context_leak.png

I have tried the patch below
-------------------------
Index: activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java       (revision 1366667)
+++ activemq-core/src/main/java/org/apache/activemq/thread/TaskRunnerFactory.java       (working copy)
@@ -108,6 +108,8 @@
                 Thread thread = new Thread(runnable, name + "-" + id.incrementAndGet());
                 thread.setDaemon(daemon);
                 thread.setPriority(priority);
+                thread.setContextClassLoader(null);
                 return thread;
             }
         });
-------------------------

Still have memory leak, now because of inherited access control context.


                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "liny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428135#comment-13428135 ] 

liny commented on AMQ-3451:
---------------------------

@Sergey

My situation is described at http://activemq.2283324.n4.nabble.com/Old-issue-Memory-leak-after-stop-web-application-in-Tomcat-tp4653959p4654028.html with a simple web app. Would you like to try to see if you can see the same problem like me? Eclipse Memory Analysis looks a good tool, will try it.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427633#comment-13427633 ] 

Sergey commented on AMQ-3451:
-----------------------------

You can't call org.apache.activemq.thread.DefaultThreadPools#shutdown when ActiveMQ libraries are in Tomcat shared lib, because calling that method will shutdown the shared thread pool, and  all other web application deployed to the same Tomcat will be unable to send any JMS messages.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Andreas Hartmann (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13170863#comment-13170863 ] 

Andreas Hartmann edited comment on AMQ-3451 at 12/16/11 9:45 AM:
-----------------------------------------------------------------

For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

----

Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }
----

Shutdown the task runner factory in a servlet context listener:

----

public class CleanupAmqThreads implements ServletContextListener {

     @Override
         public void contextInitialized(ServletContextEvent sce) {
     }

     @Override
     public void contextDestroyed(ServletContextEvent sce) {
         DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
     }
}

                
      was (Author: andreas@apache.org):
    For me the following seems to work:

Interrupt the TCP transport socket handler daemon thread:

----

Index: activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java
===================================================================
--- activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(revision 1214868)
+++ activemq-core/src/main/java/org/apache/activemq/transport/tcp/TcpTransportServer.java	(working copy)
@@ -380,6 +380,8 @@
         if (serverSocket != null) {
             serverSocket.close();
         }
+        this.socketHandlerThread.interrupt();
+        this.socketHandlerThread = null;
     }
----

Shutdown the task runner factory in a servlet context listener:

----

public class CleanupAmqThreads implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        DefaultThreadPools.getDefaultTaskRunnerFactory().shutdown();
    }
}

                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey updated AMQ-3451:
------------------------

    Comment: was deleted

(was: If ActiveMQ libraries are in tomcat shared libs, then you cannot kill the thread pool.
The thread pool (I mean org.apache.activemq.thread.DefaultThreadPools#DEFAULT_TASK_RUNNER_FACTORY) is shared between multiple web applications, so you can't kill it because it will affect other web applicaitons, all of them will be unable to use JMS)
    
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey updated AMQ-3451:
------------------------

    Attachment: patch.txt

Attached a patch which cleans the thread's context classloader and inherited security context.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "ravi bhatt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104531#comment-13104531 ] 

ravi bhatt commented on AMQ-3451:
---------------------------------

I am having similar issue where tomcat does not shut down properly because of activemq threads. 

I tried above solution org.apache.activemq.thread.DefaultThreadPools#shutdown, it does not help. I called this inside my contextDestroyed in tomcat, and it makes no difference to the situation.


> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427996#comment-13427996 ] 

Gary Tully commented on AMQ-3451:
---------------------------------

hmm, ok. so it sounds like a sensible fix is to clear and reset the tccl in the thread factory such that it is not inherited by the activemq task runner threads.
I just wonder if that behavior will break any clients, am thinking cxf and jaxb or in servicemix etc. It may need to be configurable via a system property just incase.
fancy taking a stab at a patch?
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "nimmi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447299#comment-13447299 ] 

nimmi commented on AMQ-3451:
----------------------------

Thank you very much for working on this issue.I'll check the builds page.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: AMQ-3451-broker2.patch, AMQ-3451-broker.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "ravi bhatt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104532#comment-13104532 ] 

ravi bhatt edited comment on AMQ-3451 at 9/14/11 2:41 PM:
----------------------------------------------------------

and BTW i have tested this on tomcat 5, 6 and 7 with activemq 5.5.0

The situation happens only when there were messages on the queue and messages where being processed inside onMessage of a listener. If there are no messages on the queue, it shuts down properly if we call connection close etc in cotextDestroyed.

      was (Author: ravimbhatt):
    and BTW i have tested this on tomcat 5, 6 and 7 with activemq 5.5.0


  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447171#comment-13447171 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

The org.apache.activemq.thread.DefaultThreadPools seems to be used in 2 areas
- by the broker a bit
- transports

The code for the broker, can be refactored to use a broker specific executor, so when the broker shutdown, those threads will be shutdown as well. That should be doable

The transports can be used by JMS clients as well, so I wonder as Gary says, can we use a dedicated thread pool (executor service) *per* transport?
If that would be doable, then we have start|stop callbacks on the transports, where we can ensure the thread pool is setup / shutdown properly.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated AMQ-3451:
-----------------------------

    Attachment: activemq-core-5.7-SNAPSHOT.jar
                AMQ-3541-3.patch

Patch with transport connections fixes. I also attached the core JAR for people to give a try. The other SNAPSHOT jars are in maven snapshot repo, where you can download them. As no fixes has yet been committed to the codebase.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13449862#comment-13449862 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

Okay AMQ-4026 is now committed, so we have a better API for shutting down thread pools. Will work on getting the patches in the codebase, so the JMS Client work well in Tomcat when re-deploying apps. 

A fully embedded ActiveMQ broker in Tomcat has a number of more pools and other parts in the works, eg such as JMX and whatnot that can cause a bit pain, eg to ensure all JMX stuff is properly unregistered and whatnot. 

First priority is the JMS client though.
                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>            Assignee: Claus Ibsen
>              Labels: leak, resource
>         Attachments: activemq-core-5.7-SNAPSHOT.jar, AMQ-3451-broker2.patch, AMQ-3451-broker.patch, AMQ-3541-3.patch, inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428167#comment-13428167 ] 

Sergey edited comment on AMQ-3451 at 8/3/12 3:10 PM:
-----------------------------------------------------

@liny

I have downloaded the application from https://docs.google.com/open?id=0B-ZFcczN9qxYZmh5dDdoMFVCUkE, and analyzed the heap dump.

I don't see any memory leaks related to threads, the only memory leak with your web application is  AMQ-3959
                
      was (Author: sgri):
    @liny

I tried to download the application from https://docs.google.com/open?id=0B-ZFcczN9qxYZmh5dDdoMFVCUkE, and analyzed the heap dump.

I don't see any memory leaks related to threads, the only memory leak with your web application is  AMQ-3959
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Sergey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13427633#comment-13427633 ] 

Sergey edited comment on AMQ-3451 at 8/2/12 9:28 PM:
-----------------------------------------------------

You can't call org.apache.activemq.thread.DefaultThreadPools#shutdown when ActiveMQ libraries are in Tomcat shared libs, because calling that method will shutdown the shared thread pool, and  all other web application deployed to the same Tomcat will be unable to send any JMS messages. You can do that when ActiveMQ libraries are packaged into web application only.
                
      was (Author: sgri):
    You can't call org.apache.activemq.thread.DefaultThreadPools#shutdown when ActiveMQ libraries are in Tomcat shared lib, because calling that method will shutdown the shared thread pool, and  all other web application deployed to the same Tomcat will be unable to send any JMS messages.
                  
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "John Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084896#comment-13084896 ] 

John Miller commented on AMQ-3451:
----------------------------------

My connection factory is declared in web.xml

<!-- Standalone ActiveMQ -->       
     <Resource name="jms/connectionFactory" auth="Container" type="org.apache.activemq.ActiveMQConnectionFactory"
            description="Repository JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory"
            brokerURL="failover:(tcp://localhost:61616)?timeout=3000&amp;jms.redeliveryPolicy.maximumRedeliveries=2&amp;jms.redeliveryPolicy.initialRedeliveryDelay=3000L&amp;jms.redeliveryPolicy.useExponentialBackOff=false"
            brokerName="LocalActiveMQBroker"/>

> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447162#comment-13447162 ] 

Claus Ibsen commented on AMQ-3451:
----------------------------------

If people only run 1 broker in the JVM, we could as a temporary fix, add some flag/option/whatever to tell the broker, to shutdown these thread pools when the BrokerService is shutdown.

Its of course a bit tricker when its a JMS client, as that would be some stop logic in a ConnectionFactory or the likes, to get a callback when to shutdown.

                
> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>         Attachments: inherited_access_cotrol_context_leak.png, patch.txt, transport_thread_leak.png
>
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (AMQ-3451) Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread

Posted by "John Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AMQ-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Miller reopened AMQ-3451:
------------------------------


> Tomcat 6.0.32 complains that ActiveMQ 5.5 doesn't shutdown a thread
> -------------------------------------------------------------------
>
>                 Key: AMQ-3451
>                 URL: https://issues.apache.org/jira/browse/AMQ-3451
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.5.0
>         Environment: jdk 1.6.0_23 for Linux 64 bit, Ubuntu 11.04
> Tomcat 6.0.32
> Spring 3.0.5
>            Reporter: John Miller
>              Labels: leak, resource
>
> Every time when restarting web application in Tomcat Manager I get messages:
> SEVERE: The web application [/sms] appears to have started a thread named [ActiveMQ Task-3] but has failed to stop it. This is very likely to create a memory leak.
> With every restart PermGen space is increased and finally i got OutOfMemory error for PermGen space.
> I use Spring DefaultMessageListenerContainer, and it's shutdown method closes properly receivers threads. What is "ActiveMQ Task-3" thread and how to close it properly ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira