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 EDD5F4C52 for ; Wed, 11 May 2011 18:16:30 +0000 (UTC) Received: (qmail 75555 invoked by uid 500); 11 May 2011 18:16:30 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 75511 invoked by uid 500); 11 May 2011 18:16:30 -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 75464 invoked by uid 99); 11 May 2011 18:16:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 May 2011 18:16:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Wed, 11 May 2011 18:16:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 19C5F454EA for ; Wed, 11 May 2011 18:15:48 +0000 (UTC) Date: Wed, 11 May 2011 18:15:48 +0000 (UTC) From: "Martin Carpella (JIRA)" To: dev@activemq.apache.org Message-ID: <762540761.4002.1305137748102.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <80915506.3996.1305137747885.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (AMQ-3316) Memory leak in ConnectionStateTracker with MessagePull objects 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-3316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Martin Carpella updated AMQ-3316: --------------------------------- Attachment: connectionstatetracker.patch Patch with proposed fix for the issue. Applies to both 5.4.2 and 5.5.0. > Memory leak in ConnectionStateTracker with MessagePull objects > -------------------------------------------------------------- > > Key: AMQ-3316 > URL: https://issues.apache.org/jira/browse/AMQ-3316 > Project: ActiveMQ > Issue Type: Bug > Affects Versions: 5.4.2, 5.5.0 > Reporter: Martin Carpella > Attachments: connectionstatetracker.patch > > > We discovered a memory leak in {{ConnectionStateTracker}} in case a long-lived connection with prefetch=0 is used. > If prefetch=0 is used, {{MessagePull}} objects are enqueued in {{messageCache}} with an estimated size of 400. But in the cache's {{removeEldestEntry()}} method no size is subtracted from {{currentCacheSize}} for {{MessagePull}} instances. This messes with the cache as it will continue to remove objects even if there is space in the cache. But after about 5,368,709 consumed messages this will cause the {{currentCacheSize}} to roll-over maximum integer and become negative. As a consequence, for the next about 5,368,709 no messages will be removed from the cache any longer. > This sooner or later will trigger out-of-memory conditions, depending on the size of the various pools. In our case this caused out-of-memory in PermGen first, as message IDs seem to be internalized, and PermGen is considerably smaller than the heap. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira