From owner-freebsd-questions@FreeBSD.ORG Thu May 20 06:29:58 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 16C4316A4CE for ; Thu, 20 May 2004 06:29:58 -0700 (PDT) Received: from out006.verizon.net (out006pub.verizon.net [206.46.170.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB1A843D49 for ; Thu, 20 May 2004 06:29:57 -0700 (PDT) (envelope-from cswiger@mac.com) Received: from mac.com ([68.161.84.3]) by out006.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20040520132944.XSAA3317.out006.verizon.net@mac.com>; Thu, 20 May 2004 08:29:44 -0500 Message-ID: <40ACB26C.9060901@mac.com> Date: Thu, 20 May 2004 09:28:12 -0400 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Till Plewe References: <20040520050918.GA85327%till@score.is.tsukuba.ac.jp> In-Reply-To: <20040520050918.GA85327%till@score.is.tsukuba.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out006.verizon.net from [68.161.84.3] at Thu, 20 May 2004 08:29:44 -0500 cc: freebsd-questions@freebsd.org Subject: Re: memory allocation/deallocation (malloc experts needed) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 13:29:58 -0000 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... -- -Chuck