Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2002 15:55:35 +0100 (CET)
From:      Harti Brandt <brandt@fokus.gmd.de>
To:        cjp <cjp@sandstorm.net>
Cc:        mitko@rila.bg, <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Swapping performance
Message-ID:  <20020307155432.A99061-100000@beagle.fokus.gmd.de>
In-Reply-To: <05fe01c1c5e6$6a02e890$2400010a@eight>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 7 Mar 2002, cjp wrote:

You are probably misinformed, because FreeBSD also does overcommit of
memory. If you look up the mail archives you will find long battles about
the pros and cons of this.

harti

c>This is a comparison of how fast Linux can do something
c>STUPID versus how fast a real OS can do something intelligently.  Your
c>test is giving you misleading, and dangerous numbers.  Do not go waving them
c>around until you have actually looked at mallocs behavior on the different
c>systems.
c>
c>Here's why:
c>
c>Linux implements a brain dead memory allocation
c>scheme called memory overcommit.  It will let you malloc
c>as much memory as you want whether it is available as RAM or not
c>and only bitch when you try to use the memory.  Therefore,
c>Linux malloc is much faster than any reasonable system, since all it is doing is
c>handing out address space out of unallocated address space,
c>not  keeping track of  how much memory there actually is.
c>
c>In order to handle the kruft that occurs, there is the out of memory killer,
c>oom_killer.
c>Which merrily goes through the list of processes, killing off the low priority
c>processes
c>until enough memory is free to satisfy what was most recently used.  It's the
c>loan shark
c>repayment program, with OOMKiller performing the function of the deliquency
c>reminder.
c>
c>On any of the BSD system, you actually get memory you can use, and all the
c>overhead
c>of assuring its existence at the time of allocation.  Much more robust, less
c>prone to abuse.
c>
c>Try it, you'll like it.  If you want the nuts and bolts of it, read the source.
c>
c>
c>----- Original Message -----
c>From: "Dimitar Peikov" <mitko@rila.bg>
c>To: <freebsd-hackers@freebsd.org>
c>Sent: Thursday, March 07, 2002 3:45 AM
c>Subject: Swapping performance
c>
c>
c>> I start some performance tests on -stable and on SuSE 7.1 / 2.4.17. I
c>> don't comment about 'bzero' performance, but when RAM is over, Linux
c>> is much faster. I have no idea what is the algorithm of swapping but it seems
c>that the granularity of swapping pieces is the key or the importance of swapping
c>memory blocks of certain task. Ooo I forgot to say that the both machines have
c>the same hardware, IBM 300PL, 256 RAM and no other tasks running. I had to run
c>these tests to choose the fastest platform for building our software indexes,
c>which requires a lot of math and memory operations.
c>>
c>> --- with bzero ---
c>> Linux$ time ./malloc_test
c>> *#
c>> real    0m37.640s
c>> user    0m1.370s
c>> sys     0m2.950s
c>> Linux$
c>>
c>> FreeBSD$ time ./malloc_test
c>> *#
c>> real    0m46.640s
c>> user    0m2.280s
c>> sys     0m2.550s
c>> FreeBSD$
c>>
c>> --- without bzero ---
c>> Linux$ time ./malloc_test
c>> *#
c>> real    0m6.371s
c>> user    0m0.450s
c>> sys     0m1.510s
c>> Linux$
c>>
c>> FreeBSD$ time ./malloc_test
c>> *#
c>> real    0m11.571s
c>> user    0m1.150s
c>> sys     0m1.830s
c>> FreeBSD$
c>>
c>>
c>>
c>> --
c>> Dimitar Peikov
c>> Programmer Analyst
c>> Globalization Group
c>> "We Build e-Business"
c>>
c>> RILA Solutions
c>> 27 Building, Acad.G.Bonchev Str.
c>> 1113 Sofia, Bulgaria
c>>
c>> phone: (+359 2) 9797320
c>> phone: (+359 2) 9797300
c>> fax:   (+359 2) 9733355
c>> http://www.rila.com
c>>
c>
c>
c>To Unsubscribe: send mail to majordomo@FreeBSD.org
c>with "unsubscribe freebsd-hackers" in the body of the message
c>

-- 
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
              brandt@fokus.fhg.de


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?20020307155432.A99061-100000>