Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 9162 invoked from network); 17 Feb 2010 21:00:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Feb 2010 21:00:08 -0000 Received: (qmail 80398 invoked by uid 500); 17 Feb 2010 21:00:06 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 80313 invoked by uid 500); 17 Feb 2010 21:00:06 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 80296 invoked by uid 99); 17 Feb 2010 21:00:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 21:00:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of trawick@gmail.com designates 209.85.210.171 as permitted sender) Received: from [209.85.210.171] (HELO mail-yx0-f171.google.com) (209.85.210.171) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Feb 2010 20:59:59 +0000 Received: by yxe1 with SMTP id 1so33621yxe.3 for ; Wed, 17 Feb 2010 12:59:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=En1Ndb8KFWg6at9Hso4m+lJyWz/77WF0Dxj56+Ypvr0=; b=AGeTJKlEEpdWH7TUBDuuKE3g3TiUKP0XAoQPDWpC8S5U0kZOfrXyFHKpQPLwr3YAQx yTG5ff/yTz/bRkWFhC8w/clEyCpnyn/hkXS4MhY7OuRBA1rYpklxiuXL6YWTj/3SQNzY 3wqJBZ2z+RMMepVSJtkV9t4AD12J27I+VsvQ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=j22DifKJ4N8Ly41hdPv9ELxrG/nx3GL8p8OCXzlAwXqZznxm2xuGOVInTUExE3FxIv UpNnCcDxHdtg5UhJasNcau7K8Z//ytAXYZ3vvwovNau05Y2gtPkBK07Dwn87vmHkTB00 PdN2wrtQrCxnu/pMPY2mlXT83UaPcaskGnDNI= MIME-Version: 1.0 Received: by 10.100.28.36 with SMTP id b36mr4445452anb.185.1266440379022; Wed, 17 Feb 2010 12:59:39 -0800 (PST) In-Reply-To: <201002172126.28301.sf@sfritsch.de> References: <20100217161036.GA9086@redhat.com> <201002172126.28301.sf@sfritsch.de> Date: Wed, 17 Feb 2010 15:59:38 -0500 Message-ID: Subject: Re: Finding memory leaks in httpd and httpd modules From: Jeff Trawick To: dev@httpd.apache.org, dev@apr.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Feb 17, 2010 at 3:26 PM, Stefan Fritsch wrote: > On Wednesday 17 February 2010, Joe Orton wrote: >> On Wed, Feb 17, 2010 at 09:12:03AM -0500, Jeff Trawick wrote: >> > a. get the server to steady state >> >> ... >> >> > b. see what causes the heap to expand (brk/sbrk) >> >> This is what I do too, FWIW. =A0It's primitive but usually effective. > > What about adding some code to apr-util's bucket debugging that logs > when destroyed brigades (i.e. where the pool cleanup has been removed) > are reused? I think this may be a common cause for memory leaks. as in something like this? apr_brigade_destroy(foo->bb) ... if (!foo->bb) { foo->bb =3D apr_brigade_create(); } ... APR_BRIGADE_INSERT_TAIL(foo->bb, b); /* no automatic cleanup of b */ > A simpler alternative would be to set bb->pool and bb->bucket_alloc to > NULL in apr_brigade_destroy(). The latter could maybe even be enabled > in some apr-util maintainer mode (just like httpd enables some > debugging in maintainer mode). APR_BRIGADE_CHECK_CONSISTENCY() would presumably be changed to abort if !bb->pool