You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Xavier Toth (JIRA)" <ji...@apache.org> on 2007/03/27 17:04:34 UTC

[jira] Created: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

threads not stopping causing memory leaks which can lead to OutOfMemoryError
----------------------------------------------------------------------------

                 Key: AMQ-1214
                 URL: https://issues.apache.org/activemq/browse/AMQ-1214
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 4.1.0
         Environment: Fedora Core 6
            Reporter: Xavier Toth
         Attachments: threadleak.tar.gz

Threads started by ActiveMQ on behalf of a client persist in a ThreadGroup despite calling the 'interrupt' method on the group thereby leaking memory.  

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


Re: [jira] Created: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

Posted by anish pathadan <an...@gmail.com>.
Hi All,
    I tested this issue, the threads which are not stopped are readeChecker
and writeChecker threads started from InactivityMonitor. These two threads
are created as daemon threads. Can anybody please explain me the reason for
creating these threads as daemon threads when TCPTransport itself is a non
daemon thread.

Thanks,
Anish


JIRA jira@apache.org wrote:
> 
> threads not stopping causing memory leaks which can lead to
> OutOfMemoryError
> ----------------------------------------------------------------------------
> 
>                  Key: AMQ-1214
>                  URL: https://issues.apache.org/activemq/browse/AMQ-1214
>              Project: ActiveMQ
>           Issue Type: Bug
>     Affects Versions: 4.1.0
>          Environment: Fedora Core 6
>             Reporter: Xavier Toth
>          Attachments: threadleak.tar.gz
> 
> Threads started by ActiveMQ on behalf of a client persist in a ThreadGroup
> despite calling the 'interrupt' method on the group thereby leaking
> memory.  
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28AMQ-1214%29-threads-not-stopping-causing-memory-leaks-which-can-lead-to-OutOfMemoryError-tf3473682s2354.html#a10214262
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: [jira] Reopened: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

Posted by ArmenH <ge...@netscape.net>.
We used jhat and found out that there are over 1.6 million instances of the
org.apache.activemq.filter.DestinationMapNode after just deploying one
service in ServiceMix.

The second largest number of instances is 3001.   




ArmenH wrote:
> 
> We are using ServiceMix 3.1 and getting hit by this issue when we deploy a
> service.  The memory usage on  the PC grows by half GB for every deployed
> service and at some point ServiceMix just dies with the OutOfMemoryError
> error.  This is a critical issue for us.  Please advise.
> 
> 
> JIRA jira@apache.org wrote:
>> 
>> 
>>      [
>> https://issues.apache.org/activemq/browse/AMQ-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
>> ]
>> 
>> Stefan Reuter reopened AMQ-1214:
>> --------------------------------
>> 
>> 
>> I have two problems with this issue:
>> 1. You shouldn't set the resolution to "fixed" when you didn't fix
>> anything :-)
>> 2. "threads persisted are valid" - this depends on what you consider
>> valid.
>> 
>> When deployed to a web container like Tomcat the threads are not shut
>> down and cause a PermGen leak. The fix would be quite easy: Just shut it
>> down in some destroy method or at least make it clear to user's that they
>> have to take care of the clean up.
>> 
>> More information:
>> 
>> http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05687.htmlvv
>> http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05706.html
>> 
>> http://blogs.reucon.com/srt/2007/07/20/java_lang_outofmemoryerror_permgen_space.html
>> 
>>> threads not stopping causing memory leaks which can lead to
>>> OutOfMemoryError
>>> ----------------------------------------------------------------------------
>>>
>>>                 Key: AMQ-1214
>>>                 URL: https://issues.apache.org/activemq/browse/AMQ-1214
>>>             Project: ActiveMQ
>>>          Issue Type: Bug
>>>    Affects Versions: 4.1.0
>>>         Environment: Fedora Core 6
>>>            Reporter: Xavier Toth
>>>         Attachments: test.java, threadleak.tar.gz
>>>
>>>
>>> Threads started by ActiveMQ on behalf of a client persist in a
>>> ThreadGroup despite calling the 'interrupt' method on the group thereby
>>> leaking memory.  
>> 
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28AMQ-1214%29-threads-not-stopping-causing-memory-leaks-which-can-lead-to-OutOfMemoryError-tf3473682s2354.html#a11756592
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: [jira] Reopened: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

Posted by ArmenH <ge...@netscape.net>.
We are using ServiceMix 3.1 and getting hit by this issue when we deploy a
service.  The memory usage on  the PC grows by half GB for every deployed
service and at some point ServiceMix just dies with the OutOfMemoryError
error.  This is a critical issue for us.  Please advise.


JIRA jira@apache.org wrote:
> 
> 
>      [
> https://issues.apache.org/activemq/browse/AMQ-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
> 
> Stefan Reuter reopened AMQ-1214:
> --------------------------------
> 
> 
> I have two problems with this issue:
> 1. You shouldn't set the resolution to "fixed" when you didn't fix
> anything :-)
> 2. "threads persisted are valid" - this depends on what you consider
> valid.
> 
> When deployed to a web container like Tomcat the threads are not shut down
> and cause a PermGen leak. The fix would be quite easy: Just shut it down
> in some destroy method or at least make it clear to user's that they have
> to take care of the clean up.
> 
> More information:
> 
> http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05687.htmlvv
> http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05706.html
> 
> http://blogs.reucon.com/srt/2007/07/20/java_lang_outofmemoryerror_permgen_space.html
> 
>> threads not stopping causing memory leaks which can lead to
>> OutOfMemoryError
>> ----------------------------------------------------------------------------
>>
>>                 Key: AMQ-1214
>>                 URL: https://issues.apache.org/activemq/browse/AMQ-1214
>>             Project: ActiveMQ
>>          Issue Type: Bug
>>    Affects Versions: 4.1.0
>>         Environment: Fedora Core 6
>>            Reporter: Xavier Toth
>>         Attachments: test.java, threadleak.tar.gz
>>
>>
>> Threads started by ActiveMQ on behalf of a client persist in a
>> ThreadGroup despite calling the 'interrupt' method on the group thereby
>> leaking memory.  
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-jira--Created%3A-%28AMQ-1214%29-threads-not-stopping-causing-memory-leaks-which-can-lead-to-OutOfMemoryError-tf3473682s2354.html#a11738835
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


[jira] Updated: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

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

anish pathadan updated AMQ-1214:
--------------------------------

    Attachment: test.java

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

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


[jira] Resolved: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

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

james strachan resolved AMQ-1214.
---------------------------------

    Resolution: Fixed

Thanks for the heads up Anish!

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

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


[jira] Resolved: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

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

Rob Davies resolved AMQ-1214.
-----------------------------

    Resolution: Fixed

Fix applied in SVN revision 669512

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

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


[jira] Assigned: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

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

Rob Davies reassigned AMQ-1214:
-------------------------------

    Assignee: Rob Davies

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

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


[jira] Commented: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

Posted by "anish pathadan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39078 ] 

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

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

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

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

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

Thanks,
Anish

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

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


[jira] Reopened: (AMQ-1214) threads not stopping causing memory leaks which can lead to OutOfMemoryError

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

Stefan Reuter reopened AMQ-1214:
--------------------------------


I have two problems with this issue:
1. You shouldn't set the resolution to "fixed" when you didn't fix anything :-)
2. "threads persisted are valid" - this depends on what you consider valid.

When deployed to a web container like Tomcat the threads are not shut down and cause a PermGen leak. The fix would be quite easy: Just shut it down in some destroy method or at least make it clear to user's that they have to take care of the clean up.

More information:

http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05687.htmlvv
http://www.mail-archive.com/activemq-users@geronimo.apache.org/msg05706.html

http://blogs.reucon.com/srt/2007/07/20/java_lang_outofmemoryerror_permgen_space.html

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

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