Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 75732 invoked from network); 29 Apr 2010 16:31:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Apr 2010 16:31:59 -0000 Received: (qmail 66171 invoked by uid 500); 29 Apr 2010 16:31:59 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 66145 invoked by uid 500); 29 Apr 2010 16:31:59 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 66137 invoked by uid 99); 29 Apr 2010 16:31:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Apr 2010 16:31:59 +0000 X-ASF-Spam-Status: No, hits=-1366.7 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Apr 2010 16:31:58 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3TGVawC006791 for ; Thu, 29 Apr 2010 16:31:36 GMT Message-ID: <31187820.8091272558696372.JavaMail.jira@thor> Date: Thu, 29 Apr 2010 12:31:36 -0400 (EDT) From: "Gary Tully (JIRA)" To: dev@activemq.apache.org Subject: [jira] Issue Comment Edited: (AMQ-2716) ActiveMQConnection leaks memory by caching ActiveMQTempQueue objects In-Reply-To: <8498147.7511272529651853.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ 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.