From owner-freebsd-current@FreeBSD.ORG Wed Apr 26 23:56:49 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73DC716A400; Wed, 26 Apr 2006 23:56:49 +0000 (UTC) (envelope-from jd@ugcs.caltech.edu) Received: from barf.ugcs.caltech.edu (barf.ugcs.caltech.edu [131.215.176.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3E86343D45; Wed, 26 Apr 2006 23:56:49 +0000 (GMT) (envelope-from jd@ugcs.caltech.edu) Received: by barf.ugcs.caltech.edu (Postfix, from userid 3640) id 11AD41F00C2; Wed, 26 Apr 2006 16:56:49 -0700 (PDT) Date: Wed, 26 Apr 2006 16:56:49 -0700 From: Paul Allen To: Jason Evans Message-ID: <20060426235649.GB29737@barf.ugcs.caltech.edu> References: <444F71F3.6030901@fsn.hu> <444F83AD.9040207@FreeBSD.org> <20060426182837.GA29737@barf.ugcs.caltech.edu> <444FD673.3070004@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <444FD673.3070004@FreeBSD.org> Sender: jd@ugcs.caltech.edu Cc: current@freebsd.org Subject: Re: malloc problems with MySQL? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2006 23:56:49 -0000 >From Jason Evans , Wed, Apr 26, 2006 at 01:22:11PM -0700: > This code behaves as intended. Note that in order to get chunk-aligned > memory via mmap(), it is necessary to over-allocate, then trim. By > keeping a cache of unmapped chunks, we can avoid the extra system calls > most of the time, and we are also able to reduce memory fragmentation in > many cases. (Over-allocation and trimming fails to utilize chunk-sized > holes in the memory map.) Yes, I see... perhaps mmap should be enhanced to take an optional alignment parameter. :o) Paul