On 2/11/07, Kevin Brosius <[EMAIL PROTECTED]> wrote:
On 2007-02-05 20:24, Dan Streetman wrote:
> On 2/5/07, Nicolas Maufrais <[EMAIL PROTECTED]> wrote:
> > Heroine Virtual Ltd recommends disabling swap when a lot of memory is
> > installed.
>
> This is not a good idea under any circumstances.  Disabling swap will
> never help anything or improve performance, ever.  It will only cause
> the system to start killing processes when you use up all system
> memory.  Do not disable swap.

Hi Dan,

This will only be true for kernels with the OOM killer running, right?

Is "running" the right adjective?  I think the OOM killer is part of
the memory allocation subsystem, not a kernel process, right?  So ever
since it was added to the kernel it is there.  I don't think you can
build a kernel without it these days, can you?  But if you mean
kernels before the OOM killer was added, sure...that was a looong time
ago tho.

But that's beside the point.  If you run out of memory, either the
kernel kills picks a single program to kill and let everything else in
the system live (i.e. with OOM killer), or _everything_ on the system
dies a slow and painful death (i.e. without OOM killer).

Here's the link to comments from Cinelerra's author about swap usage:
http://cvs.cinelerra.org/docs/wiki/doku.php?id=english_manual:cinelerra_cv_en_20#disabling_swap_space

I've seen system behavior that makes me believe his comments about disk
caching using system memory (back in ext2 days.)  Maybe this is no
longer true for newer kernels.  But I suspect your 'never help' comment
might be overzealous.  ;)  Would you say newer kernels with current
versions of filesystems no longer exhibit this behavior?  Or is
something else going on here?

Ok, maybe "never help" is a bit extreme... ;-)

Recent kernels do not start swapping pages out when memory is 1/2 full
(as stated in that FAQ).  I'm typing this from a system with 1G of
memory, 900M of which is in use right now, and swap is 588K.  I've
been using Linux (Slackware) since 1997, and I don't ever remember
that behavior.  But hey, I can't say for sure that it has never been
true.  There very well may be some very old kernels that swap
overzealously like that...I can only say I've never seen it in ~10
years of Linux use.

I would recommend 2 things, first get a program that constantly
monitors system stats (I run xosview 100% of the time and have for
many years...xosview.sf.net).  Then second, (with swap enabled) start
up cinelerra and/or some other large programs and start eating up
memory.  See at what point swapping starts and how much memory is
swapped.  See what happens when program memory requirements exceed
system memory, i.e. used system memory + swap used exceed total system
memory.  Then shut everything down and disable swap, and start up
those programs again and eat up more than system memory and see what
happens (hint: don't be doing anything important when you try this
:-).  Until system memory ran out, was the no-swap case any better
than the swap case?  Was swap significantly used before system memory
usage run up to near 100%?  What happened when you ran out of memory
and had no swap?

I suspect everyone will find that the system behaves identically until
memory usage gets very close to total available system memory, and
when memory usage exceeds available system memory the swap/no-swap
cases are very different.  But if the test shows no-swap is better for
you, by all means don't use swap...

_______________________________________________
Cinelerra mailing list
[email protected]
https://init.linpro.no/mailman/skolelinux.no/listinfo/cinelerra

Reply via email to