Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 80F0A9324 for ; Thu, 10 Nov 2011 17:11:15 +0000 (UTC) Received: (qmail 53983 invoked by uid 500); 10 Nov 2011 17:11:15 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 53943 invoked by uid 500); 10 Nov 2011 17:11:15 -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 53935 invoked by uid 99); 10 Nov 2011 17:11:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2011 17:11:15 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2011 17:11:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D08AD4C608 for ; Thu, 10 Nov 2011 17:10:51 +0000 (UTC) Date: Thu, 10 Nov 2011 17:10:51 +0000 (UTC) From: "Claus Ibsen (Updated) (JIRA)" To: dev@activemq.apache.org Message-ID: <608907995.18030.1320945051856.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1595714962.18005.1320944931759.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (AMQ-3588) PooledSession - Can cause memory leak in case many consumers is created by the session MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-3588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen updated AMQ-3588: ----------------------------- Attachment: after.png After is the same test with 50.000 messages and this time no memory leak > PooledSession - Can cause memory leak in case many consumers is created by the session > -------------------------------------------------------------------------------------- > > Key: AMQ-3588 > URL: https://issues.apache.org/jira/browse/AMQ-3588 > Project: ActiveMQ > Issue Type: Bug > Components: activemq-camel > Reporter: Claus Ibsen > Assignee: Claus Ibsen > Priority: Critical > Labels: activemq-pool, camel, > Fix For: 5.6.0 > > Attachments: AMQ-3588.patch, after.png, before.png > > > See (CAMEL-4657 > In the activemq-pool we have a memory leak when a PooledSession is used to create many consumers. As each consumer is added to an internal list, which in case the session is closed, the list is used to ensure all previously created consumers gets closed as well. > However if the session is used to create many consumers, then that internal list just keep growing, and causing OOME. See attached screenshots of a before vs after with the bug fix. > So to remedy this situation, we should ensure any closed consumer gets removed from that internal list. As its already closed, and therefore the session do not need to keep track of it anymore. > This bug have existed ever since AMQ-615. > The impact of this bug can be seen in CAMEL-4657, which essentially makes using Camel for request/reply over JMS with AMQ and with named replyTo queues (eg not temporary) will cause this problem. The problem manifests due Spring DMLC, which uses a MessageSelector to only pickup expected reply messages. And because the MessageSelector is created once when the consumer is created. We need to create a new Consumer, every time a new message is doing request/reply, to ensure the Message Selector gets updated. So in that situation many consumers get created, which leads to OOME as the list in PooledSession keeps growing. > It would be great if this bug fix can be backported to the 5.5 branch as well. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira