From owner-freebsd-questions@FreeBSD.ORG Fri May 21 01:12:26 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1429B16A525 for ; Fri, 21 May 2004 01:12:24 -0700 (PDT) Received: from plewe.is.tsukuba.ac.jp (plewe.is.tsukuba.ac.jp [130.158.81.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2FBD943D3F for ; Fri, 21 May 2004 01:12:23 -0700 (PDT) (envelope-from till@plewe.is.tsukuba.ac.jp) Received: from plewe.is.tsukuba.ac.jp (localhost [127.0.0.1]) i4L8HPYf008823 for ; Fri, 21 May 2004 17:17:25 +0900 (JST) (envelope-from till@plewe.is.tsukuba.ac.jp) Received: (from till@localhost) by plewe.is.tsukuba.ac.jp (8.12.11/8.12.11/Submit) id i4L8HPp1008822 for freebsd-questions@freebsd.org; Fri, 21 May 2004 17:17:25 +0900 (JST) (envelope-from till) Date: Fri, 21 May 2004 17:17:25 +0900 From: Till Plewe To: freebsd-questions@freebsd.org Message-ID: <20040521081725.GB8756%till@score.is.tsukuba.ac.jp> Mail-Followup-To: freebsd-questions@freebsd.org References: <20040520050918.GA85327%till@score.is.tsukuba.ac.jp> <40ACB26C.9060901@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40ACB26C.9060901@mac.com> User-Agent: Mutt/1.5.6i Subject: Re: memory allocation/deallocation (malloc experts needed) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: till@score.is.tsukuba.ac.jp List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 08:12:26 -0000 On Thu, May 20, 2004 at 09:28:12AM -0400, Chuck Swiger wrote: > Till Plewe wrote: > >My problem is essentially that freeing large numbers of small chunks > >of memory can be very slow. I have run into this problem twice so far. > [ ... ] > >One solution would be to divide the memory in larger regions and to > >tell malloc which chunk to use for the next few calls, respectively when a > >whole chunk could be freed. But I don't know how to do this. > > Consider using (or searching for information about) a zone-based malloc. > NEXTSTEP used one and hence Darwin/OS X probably have sources available for > you to consider... > Thanks. I will give it a try. Although I was hoping to find somebody who has already an alternative malloc implementation running. - Till