From owner-freebsd-hackers Thu Mar 7 7:30:44 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from maile.telia.com (maile.telia.com [194.22.190.16]) by hub.freebsd.org (Postfix) with ESMTP id 4773037B493 for ; Thu, 7 Mar 2002 07:30:22 -0800 (PST) Received: from d1o913.telia.com (d1o913.telia.com [195.252.44.241]) by maile.telia.com (8.11.6/8.11.6) with ESMTP id g27FUF102065 for ; Thu, 7 Mar 2002 16:30:15 +0100 (CET) Received: from falcon.midgard.homeip.net (h217n1fls20o913.telia.com [212.181.162.217]) by d1o913.telia.com (8.8.8/8.8.8) with SMTP id QAA02624 for ; Thu, 7 Mar 2002 16:30:14 +0100 (CET) Received: (qmail 3113 invoked by uid 1001); 7 Mar 2002 15:30:13 -0000 Date: Thu, 7 Mar 2002 16:30:13 +0100 From: Erik Trulsson To: cjp Cc: mitko@rila.bg, freebsd-hackers@freebsd.org Subject: Re: Swapping performance Message-ID: <20020307153012.GA1942@student.uu.se> Mail-Followup-To: cjp , mitko@rila.bg, freebsd-hackers@freebsd.org References: <20020307104518.0f73740b.mitko@rila.bg> <05fe01c1c5e6$6a02e890$2400010a@eight> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05fe01c1c5e6$6a02e890$2400010a@eight> User-Agent: Mutt/1.3.27i 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 On Thu, Mar 07, 2002 at 09:42:44AM -0500, cjp wrote: > This is a comparison of how fast Linux can do something > STUPID versus how fast a real OS can do something intelligently. Your > test is giving you misleading, and dangerous numbers. Do not go waving them > around until you have actually looked at mallocs behavior on the different > systems. > > Here's why: > > Linux implements a brain dead memory allocation > scheme called memory overcommit. It will let you malloc > as much memory as you want whether it is available as RAM or not > and only bitch when you try to use the memory. Therefore, > Linux malloc is much faster than any reasonable system, since all it is doing is > handing out address space out of unallocated address space, > not keeping track of how much memory there actually is. > > In order to handle the kruft that occurs, there is the out of memory killer, > oom_killer. > Which merrily goes through the list of processes, killing off the low priority > processes > until enough memory is free to satisfy what was most recently used. It's the > loan shark > repayment program, with OOMKiller performing the function of the deliquency > reminder. > > On any of the BSD system, you actually get memory you can use, and all the > overhead > of assuring its existence at the time of allocation. Much more robust, less > prone to abuse. > > Try it, you'll like it. If you want the nuts and bolts of it, read the source. Hate to disappoint you, but FreeBSD also overcommits memory. I believe most (or at least many) other Unix variants (including the other *BSD systems) also do that. Whether overcommit is brain-dead or a clever trick is a question which has been debated several times without any conclusive result. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message