Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Mar 2002 20:08:30 +0100
From:      Alex <FreeBSD@cybertron.tmfweb.nl>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        Mauritz Sundell <mauritz.sundell@telia.com>, questions@freebsd.org, dillon@freebsd.org
Subject:   Re[2]: swap-usage
Message-ID:  <726690700.20020308200830@cybertron.tmfweb.nl>
In-Reply-To: <20020308040128.A27224@xor.obsecurity.org>
References:  <20020308115843.O29414-100000@morgan.upsys.se> <20020308040128.A27224@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Kris,

Friday, March 08, 2002, 1:01:28 PM, you wrote:

KK> On Fri, Mar 08, 2002 at 12:54:14PM +0100, Mauritz Sundell wrote:

>> For me the swap-area is used only then the system have used
>> all available physical memory and need more and as soon as
>> the memory need decreases the swap is unused again.

There a need to keep a certain amount of memory free for caching
certain tings.

KK> That's more or less correct, except that swap isn't freed up until the
KK> memory which was swapped out is actually called upon again, and the
KK> kernel needs to load those pages back into RAM.  It's more efficient
KK> to leave it swapped out until needed and leave RAM for future use by
KK> other processes.

Is this true? If you got 128M of memory and 90% is empty wouldn't it
be more efficient to fill half the memory when the CPU has nothing
better to do, rather then wait until you need it? If you fetch it when
you need it, you still have to wait a wile.

>> Why should I have 2x the swap-space as main memory?

KK> It's a good rule of thumb, because typical system workloads need up to
KK> that amount of swap.  i.e. if you have a workstation with a typical
KK> amount 128MB of RAM, which is used for typical workstation tasks, then
KK> you'll typically need more than 128MB of RAM to actually run those
KK> tasks.

KK> If you start to run huge jobs on this machine, they won't fit into RAM
KK> at once, and the system performance will drop.

KK> The 2x rule accounts for running jobs plus all of the other background
KK> stuff which only needs to run occasionally, and so doesn't need to
KK> stay in RAM all the time.

>> A person that have a system with 64MB RAM and 128MB swap
>> wants to speed up and buy another 64MB RAM, installing the
>> RAM the swapping should decrease and the swap-area could
>> even by decreased. Ok, now the person feel that the system
>> goes smoother and tend to have more applications running
>> at the same time when before. But if he felt the system
>> was slow before update he probably dont want more swapping
>> to be done than before so why should the swap be increased
>> by an other 128MB? Why should the usage of memory suddenly
>> increase from 192MB to 384MB because of an upgrade with
>> 64MB?

KK> It's a rule of thumb, not a law of nature.  A person setting up a
KK> system will choose the amount of memory based on the kind of workload
KK> the machine will be undertaking (you want to be able to fit all of the
KK> frequently-executing processes in RAM so it doesn't have to swap).
KK> But infrequently-running processes like login shells, sleeping
KK> daemons, and transient workloads like processing a huge logfile can
KK> demand a lot more memory, which needs to be available.

I run a dual system with FreeBSD and Windows. I got 256M to run the
application under Windows. I don't come near to 64M under FreeBSD. I
don't need to have swap at all.

-- 
Best regards,
 Alex


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




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