Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2002 16:30:13 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        cjp <cjp@sandstorm.net>
Cc:        mitko@rila.bg, freebsd-hackers@freebsd.org
Subject:   Re: Swapping performance
Message-ID:  <20020307153012.GA1942@student.uu.se>
In-Reply-To: <05fe01c1c5e6$6a02e890$2400010a@eight>
References:  <20020307104518.0f73740b.mitko@rila.bg> <05fe01c1c5e6$6a02e890$2400010a@eight>

next in thread | previous in thread | raw e-mail | index | archive | help
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.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020307153012.GA1942>