You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "TH L. (JIRA)" <ji...@apache.org> on 2010/04/29 10:27:31 UTC

[jira] Created: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
--------------------------------------------------------------------

                 Key: AMQ-2716
                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker, Geronimo Integration, JMS client, Transport
    Affects Versions: 5.3.0
         Environment: 64bit, SuSE 10, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3
            Reporter: TH L.
            Priority: Critical


After running messaging several hours with about 2,000,000 asynchronous send and about 1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).

The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.

By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)

Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?

is that a bug? or did I do something wrong (wrong setup, wrong client code)?

My client code
{{{
        QueueConnection connection = null;
        QueueSession session = null;
        Queue requestQueue = null;
        Queue replyQueue = null;
        QueueReceiver receiver = null;
        QueueSender sender = null;

        try {
            connection = aConnFactory.createQueueConnection();
            connection.start();
            session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            requestQueue = getDestinationQueue();
            sender = session.createSender(requestQueue);
            replyQueue = session.createTemporaryQueue(); // using temp queue
            aRequestMessage.setJMSReplyTo(replyQueue);
            sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
            receiver = session.createReceiver(replyQueue);
            receiver.receive();
        } catch (Exception e) {
              ...
        } finally {
            try { receiver.close(); } catch (Exception ignored) {}
            try { sender.close(); } catch (Exception ignored) {}
            try { session.close(); } catch (Exception ignored) {}
            try { connection.close(); } catch (Exception ignored) {}            
        }
}}}


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


[jira] Updated: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. updated AMQ-2716:
-----------------------

    Priority: Major  (was: Minor)

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. edited comment on AMQ-2716 at 4/29/10 5:50 AM:
-----------------------------------------------------

With 
{{{
TemporaryQueue replyQueue = null;
try { 
...
replyQueue  = session.createTemporaryQueue(); // using temp queue 
...
catch (Exception e) { ... } 
finally {
try { replyQueue.delete(); } catch (Exception ignored) { ignored.printStackTrace(); }
try { receiver.close(); } catch (Exception ignored) {}
try { sender.close(); } catch (Exception ignored) {}
try { session.close(); } catch (Exception ignored) {}
try { connection.close(); } catch (Exception ignored) {} 
}
}}}

then, I got 

javax.jms.JMSException: java.lang.NullPointerException
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1255)
        at org.apache.activemq.ActiveMQConnection.deleteTempDestination(ActiveMQConnection.java:1891)
        at org.apache.activemq.command.ActiveMQTempDestination.delete(ActiveMQTempDestination.java:51)
        ...

Caused by: java.lang.NullPointerException
        at org.apache.activemq.broker.TransportConnection.processRemoveDestination(TransportConnection.java:473)
        at org.apache.activemq.command.DestinationInfo.visit(DestinationInfo.java:124)
        at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:297)
        at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:175)
        at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
        at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:210)
        at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203)
        at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
        ... 1 more




      was (Author: easyl):
    {{{
TemporaryQueue replyQueue = null;
try { 
...
session.createTemporaryQueue(); // using temp queue 
...
catch (Exception e) { ... } 
finally {
try { replyQueue.delete(); } catch (Exception ignored) { ignored.printStackTrace(); }
try { receiver.close(); } catch (Exception ignored) {}
try { sender.close(); } catch (Exception ignored) {}
try { session.close(); } catch (Exception ignored) {}
try { connection.close(); } catch (Exception ignored) {} 
}
}}}

then, I got 

javax.jms.JMSException: java.lang.NullPointerException
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1255)
        at org.apache.activemq.ActiveMQConnection.deleteTempDestination(ActiveMQConnection.java:1891)
        at org.apache.activemq.command.ActiveMQTempDestination.delete(ActiveMQTempDestination.java:51)
        ...

Caused by: java.lang.NullPointerException
        at org.apache.activemq.broker.TransportConnection.processRemoveDestination(TransportConnection.java:473)
        at org.apache.activemq.command.DestinationInfo.visit(DestinationInfo.java:124)
        at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:297)
        at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:175)
        at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
        at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:210)
        at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203)
        at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
        ... 1 more



  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Commented: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. commented on AMQ-2716:
----------------------------

does AMQ follow the javax.jms.Connection definition?
<quote>
http://java.sun.com/javaee/6/docs/api/javax/jms/Connection.html#close()
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
</quote>



> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. edited comment on AMQ-2716 at 4/29/10 9:23 AM:
-----------------------------------------------------

{quote}
target <---------------------------- sender 
 \
  \/
temp reply queue ---------------> receiver
{quote}

should I close the resource in fllowing order?
{quote}
 receiver.close();        	
 replyQueue.delete(); 
 sender.close(); 
 session.close(); 
 connection.close(); 
{quote}

does AMQ not follow the javax.jms.Connection definition?
Even in the javadoc from ActiveMQConnection#close there is the same description...
{quote}
Closing a connection causes all temporary destinations to be deleted.
{quote}
But it seems that we must delete temp queue explicitly


btw, I still cannot figure out the NPE ....




      was (Author: easyl):
    does AMQ not follow the javax.jms.Connection definition?
{quote}
http://java.sun.com/javaee/6/docs/api/javax/jms/Connection.html#close()
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
{quote}


  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Commented: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. commented on AMQ-2716:
----------------------------

{{{
TemporaryQueue replyQueue = null;
try { 
...
session.createTemporaryQueue(); // using temp queue 
...
catch (Exception e) { ... } 
finally {
try { replyQueue.delete(); } catch (Exception ignored) { ignored.printStackTrace(); }
try { receiver.close(); } catch (Exception ignored) {}
try { sender.close(); } catch (Exception ignored) {}
try { session.close(); } catch (Exception ignored) {}
try { connection.close(); } catch (Exception ignored) {} 
}
}}}

then, I got 

javax.jms.JMSException: java.lang.NullPointerException
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1255)
        at org.apache.activemq.ActiveMQConnection.deleteTempDestination(ActiveMQConnection.java:1891)
        at org.apache.activemq.command.ActiveMQTempDestination.delete(ActiveMQTempDestination.java:51)
        ...

Caused by: java.lang.NullPointerException
        at org.apache.activemq.broker.TransportConnection.processRemoveDestination(TransportConnection.java:473)
        at org.apache.activemq.command.DestinationInfo.visit(DestinationInfo.java:124)
        at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:297)
        at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:175)
        at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
        at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:210)
        at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203)
        at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
        ... 1 more




> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Updated: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. updated AMQ-2716:
-----------------------

    Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport  (was: 64bit, SuSE 10, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport)

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. edited comment on AMQ-2716 at 4/29/10 10:53 AM:
------------------------------------------------------

{quote}
target <---------------------------- sender 
 \
  \/
temp reply queue ---------------> receiver
{quote}

Now I close the resource in following order.
{quote}
 receiver.close();        	
 replyQueue.delete(); 
 sender.close(); 
 session.close(); 
 connection.close(); 
{quote}

does AMQ not follow the javax.jms.Connection definition?
Even in the javadoc from ActiveMQConnection#close there is the same description...
{quote}
Closing a connection causes all temporary destinations to be deleted.
{quote}
But it seems that we must delete temp queue explicitly




      was (Author: easyl):
    {quote}
target <---------------------------- sender 
 \
  \/
temp reply queue ---------------> receiver
{quote}

should I close the resource in fllowing order?
{quote}
 receiver.close();        	
 replyQueue.delete(); 
 sender.close(); 
 session.close(); 
 connection.close(); 
{quote}

does AMQ not follow the javax.jms.Connection definition?
Even in the javadoc from ActiveMQConnection#close there is the same description...
{quote}
Closing a connection causes all temporary destinations to be deleted.
{quote}
But it seems that we must delete temp queue explicitly


btw, I still cannot figure out the NPE ....



  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Updated: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. updated AMQ-2716:
-----------------------

    Priority: Major  (was: Critical)

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Updated: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. updated AMQ-2716:
-----------------------

    Issue Type: Improvement  (was: Bug)
      Priority: Minor  (was: Major)

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Minor
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. edited comment on AMQ-2716 at 4/29/10 10:51 AM:
------------------------------------------------------

Deleting temp queue on destroying pool would be too late.

The temp queues, created by a session, should be closed immediately when the session is closed.

Possible implementation:

When ActiveMQSession.createTemporaryQueue() is called, the ActiveMQSession hold the reference on created temp queue, 

When ActiveMQConnection.close() is called (and its referencing sessions are going to be disposed), the referenced ActiveMQSession can delete its referencing temp queues.



      was (Author: easyl):
    Or, the temp queue, created by a session, should be closed when the session is closed.

ActiveMQSession can hold the reference on temp queue, when ActiveMQSession.createTemporaryQueue() is called.

As ActiveMQConnection.close() is called (and its referencing sessions are going to be disposed), the referenced ActiveMQSession can delete the temp queue created in the session.


  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Minor
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Updated: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. updated AMQ-2716:
-----------------------

    Environment: 64bit, SuSE 10, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport  (was: 64bit, SuSE 10, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3)

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 10, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with about 2,000,000 asynchronous send and about 1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. edited comment on AMQ-2716 at 4/29/10 8:51 AM:
-----------------------------------------------------

does AMQ not follow the javax.jms.Connection definition?
{quote}
http://java.sun.com/javaee/6/docs/api/javax/jms/Connection.html#close()
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
{quote}



      was (Author: easyl):
    does AMQ follow the javax.jms.Connection definition?
<quote>
http://java.sun.com/javaee/6/docs/api/javax/jms/Connection.html#close()
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
</quote>


  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. edited comment on AMQ-2716 at 4/29/10 10:57 AM:
------------------------------------------------------

Deleting temp queue on destroying pool would be too late.

The temp queues, created by a session, should be closed immediately when the session is closed.

Possible implementation:

When ActiveMQSession.createTemporaryQueue() is called, the ActiveMQSession hold the reference on created temp queue, 

When ActiveMQConnection.close() is called (and its referencing sessions are going to be disposed), the referenced ActiveMQSession can notify ActiveMQConnection to delete corresponding temp queues.



      was (Author: easyl):
    Deleting temp queue on destroying pool would be too late.

The temp queues, created by a session, should be closed immediately when the session is closed.

Possible implementation:

When ActiveMQSession.createTemporaryQueue() is called, the ActiveMQSession hold the reference on created temp queue, 

When ActiveMQConnection.close() is called (and its referencing sessions are going to be disposed), the referenced ActiveMQSession can delete its referencing temp queues.


  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Commented: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

Gary Tully commented on AMQ-2716:
---------------------------------

it does, but the point of a connection pool is to override close and place the connection back in the pool so that it can be reused. 
It would be a nice enhancement to have the pool.close() impl delete outstanding temp destinations.

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Minor
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Commented: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

Gary Tully commented on AMQ-2716:
---------------------------------

close the consumer on the reply destination first. that npe is odd though.

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

-- 
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-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

Gary Tully edited comment on AMQ-2716 at 4/29/10 12:30 PM:
-----------------------------------------------------------

it does, but the point of a connection pool is to override close and place the connection back in the pool so that it can be reused. 
It would be a nice enhancement to have the PooledConnection.close() impl delete outstanding temp destinations before returning to the pool.

      was (Author: gtully):
    it does, but the point of a connection pool is to override close and place the connection back in the pool so that it can be reused. 
It would be a nice enhancement to have the pool.close() impl delete outstanding temp destinations.
  
> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Updated: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. updated AMQ-2716:
-----------------------

    Description: 
After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).

The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.

By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)

Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?

is that a bug? or did I do something wrong (wrong setup, wrong client code)?

My client code
{{{
        QueueConnection connection = null;
        QueueSession session = null;
        Queue requestQueue = null;
        Queue replyQueue = null;
        QueueReceiver receiver = null;
        QueueSender sender = null;

        try {
            connection = aConnFactory.createQueueConnection();
            connection.start();
            session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            requestQueue = getDestinationQueue();
            sender = session.createSender(requestQueue);
            replyQueue = session.createTemporaryQueue(); // using temp queue
            aRequestMessage.setJMSReplyTo(replyQueue);
            sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
            receiver = session.createReceiver(replyQueue);
            receiver.receive();
        } catch (Exception e) {
              ...
        } finally {
            try { receiver.close(); } catch (Exception ignored) {}
            try { sender.close(); } catch (Exception ignored) {}
            try { session.close(); } catch (Exception ignored) {}
            try { connection.close(); } catch (Exception ignored) {}            
        }
}}}


  was:
After running messaging several hours with about 2,000,000 asynchronous send and about 1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).

The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.

By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)

Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?

is that a bug? or did I do something wrong (wrong setup, wrong client code)?

My client code
{{{
        QueueConnection connection = null;
        QueueSession session = null;
        Queue requestQueue = null;
        Queue replyQueue = null;
        QueueReceiver receiver = null;
        QueueSender sender = null;

        try {
            connection = aConnFactory.createQueueConnection();
            connection.start();
            session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
            requestQueue = getDestinationQueue();
            sender = session.createSender(requestQueue);
            replyQueue = session.createTemporaryQueue(); // using temp queue
            aRequestMessage.setJMSReplyTo(replyQueue);
            sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
            receiver = session.createReceiver(replyQueue);
            receiver.receive();
        } catch (Exception e) {
              ...
        } finally {
            try { receiver.close(); } catch (Exception ignored) {}
            try { sender.close(); } catch (Exception ignored) {}
            try { session.close(); } catch (Exception ignored) {}
            try { connection.close(); } catch (Exception ignored) {}            
        }
}}}



> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 10, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Commented: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

TH L. commented on AMQ-2716:
----------------------------

Or, the temp queue, created by a session, should be closed when the session is closed.

ActiveMQSession can hold the reference on temp queue, when ActiveMQSession.createTemporaryQueue() is called.

As ActiveMQConnection.close() is called (and its referencing sessions are going to be disposed), the referenced ActiveMQSession can delete the temp queue created in the session.



> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Minor
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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


[jira] Commented: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects

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

Gary Tully commented on AMQ-2716:
---------------------------------

{code}replyQueue.delete(){code}

> ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects
> --------------------------------------------------------------------
>
>                 Key: AMQ-2716
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2716
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker, Geronimo Integration, JMS client, Transport
>    Affects Versions: 5.3.0
>         Environment: 64bit, SuSE 11, Sun Java 1.6.0_17, Geronimo 2.2, embedded AMQ 5.3, TCP Tranport
>            Reporter: TH L.
>            Priority: Critical
>
> After running messaging several hours with more than 2,000,000 asynchronous send and more than1,000,000 synchronous send/reply (with temp Queue), I found about 1.5G ActiveMQConnection objects in my whole 2G memory heap (inspected with jmap and Eclipse Memory Analyzer).
> The 1.5G ActiveMQConnection objects and their referencing objects stay in heap old generation and cannot be cleaned by GC.
> By looking into those ActiveMQConnections, I found there are a huge amount of HashMaps holding temp Queue information (e.g. ActiveMQTempQueue with different sequenceId, physicalName, etc.)
> Since the ActiveMQConnections are pooled, however, why those ActiveMQTempQueues are always kept in ActiveMQConnections?
> is that a bug? or did I do something wrong (wrong setup, wrong client code)?
> My client code
> {{{
>         QueueConnection connection = null;
>         QueueSession session = null;
>         Queue requestQueue = null;
>         Queue replyQueue = null;
>         QueueReceiver receiver = null;
>         QueueSender sender = null;
>         try {
>             connection = aConnFactory.createQueueConnection();
>             connection.start();
>             session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
>             requestQueue = getDestinationQueue();
>             sender = session.createSender(requestQueue);
>             replyQueue = session.createTemporaryQueue(); // using temp queue
>             aRequestMessage.setJMSReplyTo(replyQueue);
>             sender.send(aRequestMessage, DeliveryMode.NON_PERSISTENT, Message.DEFAULT_PRIORITY, timeToLive);
>             receiver = session.createReceiver(replyQueue);
>             receiver.receive();
>         } catch (Exception e) {
>               ...
>         } finally {
>             try { receiver.close(); } catch (Exception ignored) {}
>             try { sender.close(); } catch (Exception ignored) {}
>             try { session.close(); } catch (Exception ignored) {}
>             try { connection.close(); } catch (Exception ignored) {}            
>         }
> }}}

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