You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Steven Buberl (JIRA)" <ji...@apache.org> on 2007/09/28 18:16:23 UTC

[jira] Created: (AMQ-1437) Memory Leak in Resource Adapator?

Memory Leak in Resource Adapator?
---------------------------------

                 Key: AMQ-1437
                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same

            Reporter: Steven Buberl


I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.

To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.

I think this will be a simple fix and hopefully will be resolved soon.

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


[jira] Commented: (AMQ-1437) Memory Leak in Resource Adapator?

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

Mario Siegenthaler commented on AMQ-1437:
-----------------------------------------

Duplicate of AMQ-2166 (contains a fix)

Actually mine was the duplicate of this (didn't find it then, I appologize)

> Memory Leak in Resource Adapator?
> ---------------------------------
>
>                 Key: AMQ-1437
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same
>            Reporter: Steven Buberl
>             Fix For: 5.4.0
>
>         Attachments: mem-histo.2008.10.03.txt
>
>
> I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.
> To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.
> I think this will be a simple fix and hopefully will be resolved soon.

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


[jira] Closed: (AMQ-1437) Memory Leak in Resource Adapator?

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

Bruce Snyder closed AMQ-1437.
-----------------------------

       Resolution: Fixed
    Fix Version/s:     (was: AGING_TO_DIE)
                   5.3.0

Fixed by AMQ-2166

> Memory Leak in Resource Adapator?
> ---------------------------------
>
>                 Key: AMQ-1437
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same
>            Reporter: Steven Buberl
>             Fix For: 5.3.0
>
>         Attachments: mem-histo.2008.10.03.txt
>
>
> I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.
> To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.
> I think this will be a simple fix and hopefully will be resolved soon.

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


[jira] Commented: (AMQ-1437) Memory Leak in Resource Adapator?

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

Steven Buberl commented on AMQ-1437:
------------------------------------

In hopes of providing some evidence and encouragement, I'm posted a memory snapshot of the top 24 ActiveMQ classes by the amount of memory all its live objects take up.  The server is a Jboss server that uses ActiveMQ for all its messaging, and the server has been runing for 6 days straight.  Its sorted by total size of all reachable/live objects of the class to show you how much higher the count and total memory size of the top tier are from the rest.

{quote}
        Count  ... Total Size ... Class

	37189 ... 2360k ... org.apache.activemq.management.CountStatisticImpl
	
	18596 ... 1616k ... org.apache.activemq.management.TimeStatisticImpl
	
	9295 .... 1098k ... org.apache.activemq.management.JMSSessionStatsImpl
	
	9295 .... 1080k ... org.apache.activemq.ActiveMQSession
	
	27945 ... 436k .... org.apache.activemq.util.LongSequenceGenerator
	
	9307 .... 399k .... org.apache.activemq.command.SessionId
	
	9295 .... 335k .... org.apache.activemq.command.SessionInfo
	
	9295 .... 299k .... org.apache.activemq.ActiveMQSessionExecutor
	
	9295 .... 236k .... org.apache.activemq.MessageDispatchChannel
	
	3836 .... 194k .... org.apache.activemq.command.ProducerId
	
	9278 .... 154k .... org.apache.activemq.ra.ManagedSessionProxy
	
	24 ...... 96k ..... org.apache.activemq.command.DataStructure[]
	
	922 ..... 28k ..... org.apache.activemq.command.XATransactionId
	
	76 ...... 19k ..... org.apache.activemq.command.ActiveMQTextMessage
	
	76 ...... 6k ...... org.apache.activemq.command.MessageDispatch
	
	160 ..... 3k ...... org.apache.activemq.util.ByteSequence
	
	76 ...... 3k ...... org.apache.activemq.command.MessageId
	
	12 ...... 3k ...... org.apache.activemq.ActiveMQConnection
	
	12 ...... 1k ...... org.apache.activemq.transport.tcp.TcpTransport
	
	31 ...... 1k ...... org.apache.activemq.command.ActiveMQTopic
	
	28 ...... 1k ...... org.apache.activemq.command.ConsumerId
	
	14 ...... 1k ...... org.apache.activemq.command.ConsumerInfo
	
	21 ...... 1k ...... org.apache.activemq.TransactionContext
{quote}

And I'd like to note at any given time, on my server there are only about 15 ActiveMQSessions being used by the beans at a time but 9000 more along with all their stats and ids are stuck in memory too.

> Memory Leak in Resource Adapator?
> ---------------------------------
>
>                 Key: AMQ-1437
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same
>            Reporter: Steven Buberl
>
> I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.
> To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.
> I think this will be a simple fix and hopefully will be resolved soon.

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


[jira] Issue Comment Edited: (AMQ-1437) Memory Leak in Resource Adapator?

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

ikoblik edited comment on AMQ-1437 at 10/3/08 7:30 AM:
-----------------------------------------------------------

We seem to have same problem. Complete memory histogram is attached to the issue.

      was (Author: ikoblik):
    We seem to have same problem. Complete memory histogram is attached to the issues.
  
> Memory Leak in Resource Adapator?
> ---------------------------------
>
>                 Key: AMQ-1437
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same
>            Reporter: Steven Buberl
>             Fix For: 5.3.0
>
>         Attachments: mem-histo.2008.10.03.txt
>
>
> I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.
> To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.
> I think this will be a simple fix and hopefully will be resolved soon.

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


[jira] Commented: (AMQ-1437) Memory Leak in Resource Adapator?

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

Ivan Koblik commented on AMQ-1437:
----------------------------------

It looks like we didn't use sessions right. We were opening them but not closing afterwards, it was OK when we had a new connection per message, but as soon as we moved to the single connection factory, memory leak became apparent.

> Memory Leak in Resource Adapator?
> ---------------------------------
>
>                 Key: AMQ-1437
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same
>            Reporter: Steven Buberl
>             Fix For: 5.3.0
>
>         Attachments: mem-histo.2008.10.03.txt
>
>
> I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.
> To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.
> I think this will be a simple fix and hopefully will be resolved soon.

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


[jira] Updated: (AMQ-1437) Memory Leak in Resource Adapator?

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

Ivan Koblik updated AMQ-1437:
-----------------------------

    Attachment: mem-histo.2008.10.03.txt

We seem to have same problem. Complete memory histogram is attached to the issues.

> Memory Leak in Resource Adapator?
> ---------------------------------
>
>                 Key: AMQ-1437
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1437
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>         Environment: Ran on ActiveMQ 4.1.1 but ActiveMQ 5.0's code is the same
>            Reporter: Steven Buberl
>             Fix For: 5.3.0
>
>         Attachments: mem-histo.2008.10.03.txt
>
>
> I think it is a memory leak that calling close() on a org.apache.activemq.ra.ManagedSessionProxy does not remove it from the session list of the org.apache.activemq.ra.ManagedConnectionProxy that created it.  Some programs (like mine) run on a Jboss bean thats generating messages every few seconds and I like to keep a Connection open to ActiveMQ and create a new session for each new batch of messages.  When I close these sessions (which are really ManagedSessionProxy's), the actual ActiveMQSession wrapped inside closes but a lot of its data remains referenced inside it.   Also, the reference to the ManagedSessionProxy stays in the ManagedConnectionProxy's session list.  So since the ManagedSessionProxy has to stay in the ManagedConnectionproxy's session list, it stays in memory and so does the ActiveMQSession, and so all these sessions (thousands of them) stay in memory until the ManagedConnectionProxy is closed which my program only calls when the server shuts down.
> To generate this, create a simple message producing program that uses the resource adaptor's ActiveMQConnectionFactory to generate one connection.  Then run a loop that creates a session on that connection, sends a message or two, and closes the session.  May need to run this loop at least 100 times appreciate what I'm saying and how quickly it affects things.
> I think this will be a simple fix and hopefully will be resolved soon.

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