From owner-freebsd-hackers Wed Oct 23 11:50:34 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B736037B401 for ; Wed, 23 Oct 2002 11:50:32 -0700 (PDT) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34DAF43E42 for ; Wed, 23 Oct 2002 11:50:32 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id g9NIoOU7000636; Wed, 23 Oct 2002 11:50:24 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id g9NIoOXD000635; Wed, 23 Oct 2002 11:50:24 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Wed, 23 Oct 2002 11:50:24 -0700 From: David Schultz To: Poul-Henning Kamp Cc: Danny Braniss , freebsd-hackers@FreeBSD.ORG Subject: Re: malloc Message-ID: <20021023185024.GA468@HAL9000.homeunix.com> Mail-Followup-To: Poul-Henning Kamp , Danny Braniss , freebsd-hackers@FreeBSD.ORG References: <20021023165929.GA7863@HAL9000.homeunix.com> <43186.1035395104@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43186.1035395104@critter.freebsd.dk> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Poul-Henning Kamp : > In message <20021023165929.GA7863@HAL9000.homeunix.com>, David Schultz writes: > > >You can find a somewhat more thorough comparison of malloc > >implementations at http://citeseer.nj.nec.com/440671.html . > > There are many problems with this paper, and my feeling is that it was > written with a very specific purpose in mind, although I havn't been > able to figure out just what that purpose was. I did say `somewhat', didn't I? ;-) As I mentioned in the part of my message that you didn't quote, I don't much care for the paper either, but it's the only half-reasonable comparison I know of. I don't think the authors know what they're talking about, but they did collect extensive data for some real world programs, which I assume is valid. I agree that the behavior of the program from the point of view of the VM system is the most important metric. But internal and external fragmentation are also significant issues. Often, these are a result of programmers not understanding how their malloc works. For example, programs that make numerous 2K allocations in phkmalloc will get twice the amount of memory they asked for, and since each chunk is page-aligned, it will be twice as bad for the VM system. A harder problem to solve is fragmentation for long-running servers, where the RSS tends to creep upwards over time as virtual memory fills with holes. There seems to be a fair amount of research on the subject, although I'm not well read on it. The phkmalloc bucket approach seems to work quite well, as the aforementioned paper claims. I'm guessing that one of these days it will have to be modified for threaded applications to reduce false sharing on SMP systems. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message