From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 14 02:49:41 2005 Return-Path: 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 9464616A4CE for ; Mon, 14 Feb 2005 02:49:41 +0000 (GMT) Received: from ms-smtp-02-eri0.southeast.rr.com (ms-smtp-02-lbl.southeast.rr.com [24.25.9.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFB2943D4C for ; Mon, 14 Feb 2005 02:49:40 +0000 (GMT) (envelope-from jason@ec.rr.com) Received: from BARTON (cpe-065-184-201-054.ec.rr.com [65.184.201.54]) j1E2nced004331 for ; Sun, 13 Feb 2005 21:49:38 -0500 (EST) Date: Mon, 14 Feb 2005 02:56:43 +0000 From: Jason Henson To: freebsd-hackers@freebsd.org References: <1108277558l.86500l.0l@BARTON> <20050213082128.GA68307@VARK.MIT.EDU> X-Mailer: Balsa 2.2.6 Message-Id: <1108349803l.26586l.0l@BARTON> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Symantec AntiVirus Scan Engine Subject: Re: malloc vs ptmalloc2 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2005 02:49:41 -0000 On 02/13/05 03:21:29, David Schultz wrote: > On Sun, Feb 13, 2005, Jason Henson wrote: > > I saw on a few of the lists here how linux uses ptmalloc2 and it > > outperforms bsd's malloc. I tried to do some research into it and > > found PHK's pdf on it and it seems bsd's malloc was ment to be ok =20 > in >=20 > > most every situation. Because of this it shines when primary =20 > storage > is > > seriously over committed. > > > > So here is my question, I use FreeBSD as a desktop and never ever > use > > swap(I just don't stress my system enough?), can I use ptmalloc in > > stead of malloc? Like defining SCHED_ULE instead of SCHED_4BSD. > Can > > the system malloc be switched out? >=20 > With a little bit of work, you should be able to replace > src/lib/libc/stdlib/malloc.c. ptmalloc is much more heavyweight, > but it would probably do better in cases where you have a large > number of threads doing a massive number of malloc/free operations > on a multiprocessor system. Other than that, I don't know enough > details about ptmalloc to speculate, except to say that for most > real-world workloads on modern systems, the impact of the malloc > implementation is likely to be negligible. Of course, test > results would be interesting... I see what you mean by heavy weight! Looking through the sources. The =20 gains looked promising in this thread http://docs.freebsd.org/cgi/mid.cgi?420BB1FF.11156.68F6CEC I might find the time for it, and if I do I hope it is not too =20 difficult.