Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 31882 invoked from network); 2 Oct 2008 07:23:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2008 07:23:33 -0000 Received: (qmail 16822 invoked by uid 500); 2 Oct 2008 07:23:31 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 16766 invoked by uid 500); 2 Oct 2008 07:23:31 -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 16755 invoked by uid 99); 2 Oct 2008 07:23:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 00:23:31 -0700 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 justin.erenkrantz@gmail.com designates 209.85.217.21 as permitted sender) Received: from [209.85.217.21] (HELO mail-gx0-f21.google.com) (209.85.217.21) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 07:22:30 +0000 Received: by gxk14 with SMTP id 14so1088937gxk.19 for ; Thu, 02 Oct 2008 00:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=lzZOSAzGyHxst/J02wCLGumI3h6DRwIAOcPzcUX7b+o=; b=lJPVcqfZtEhFvd8tmrPlcLWUUPQ/oi3WsgFxZw5SqZJNNVdZTCC9sA0uzOUvo4G5zD ThEEZnUA0rKrJxPv9yU8Kbyh/tl/t2Q3Wjnmszia4cAe8OStYKBJq7uhoFW4MruMMHRs ECaljleUZqgbqy6JfEbDGULgZdhhc9BhQsM5k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=kD1ROmieWWxihF78xTyYMkhPARHu6nX505MFlVbaGl94wQnaX47ZN2YWkdJUIfqDjZ MVa3PG+DIx5iqcwitKURtEfVvORRJDtUIpCZLdzwObGve9sbdUMsoRCTMFYtzdvCqedl s2H12k6i6TLalaqUNviuWUUQuIJzSrvtD/eXw= Received: by 10.150.181.7 with SMTP id d7mr5948151ybf.206.1222932124321; Thu, 02 Oct 2008 00:22:04 -0700 (PDT) Received: by 10.151.79.21 with HTTP; Thu, 2 Oct 2008 00:22:04 -0700 (PDT) Message-ID: <5c902b9e0810020022t49d34fbmb5caacd6b24a142@mail.gmail.com> Date: Thu, 2 Oct 2008 00:22:04 -0700 From: "Justin Erenkrantz" Sender: justin.erenkrantz@gmail.com To: "Ben Collins-Sussman" Subject: Re: apr pools & memory leaks Cc: "Subversion Developers" , dev@apr.apache.org In-Reply-To: <53c059c90810011111v37c36635y7279870f9bc852a0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <53c059c90810011111v37c36635y7279870f9bc852a0@mail.gmail.com> X-Google-Sender-Auth: 194af41904812d1d X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Oct 1, 2008 at 11:11 AM, Ben Collins-Sussman wrote: > In the long term, I think we need to question the utility of having > APR do memory recycling at all. Back in the early 90's, malloc() was > insanely slow and worth avoiding. In 2008, now that we're running > apache with nothing but malloc/free, we're unable measure any > performance hit. The whole pool interface is really nice, but I > wonder if pool recycling may just be unnecessary on modern hardware > and OSes. If you are using a specialized malloc implementation (like Google's TCmalloc), then it will almost certainly be doing recycling underneath for you in some fashion. These packages are largely optional, and I'm not aware of any OS that has these functionalities enabled by *default*. (Solaris and Mac OS X have them available, but need to be turned on by environment variables or other linker tricks, IIRC.) However, yes, there are more smarter malloc implementations than there were 10 years ago...but I don't think it's prevalent enough where APR should just assume that malloc()/free() is inherently cheap unless it were to bundle one of those libraries directly. (Google's TCmalloc is C++, but there are others that are likely reasonably portable too.) BTW, implicit in the reason why there is not a noticeable performance hit with malloc/free off for you is that you probably *are* using TCmalloc or some special Google library that handles the memory recycling already. =) -- justin