lkml.org 
[lkml]   [2000]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Overcommitable memory??
> >    Swap isn't necessary. Swap is just a cheap and slow alternative to RAM
> > chips, that's why most people use it, hoping mostly inactive parts of
> > memory have to be implemented as swap, but swap isn't necessary. It is
> > quite possible to run production Linux systems without any swap. Been
> > there, done that.
>
> Interestingly, I have to reluctlantly accede. Performance is noticably
> better on my workstation without swap.

I really doubt that's true.

> total used free shared buffers cached
> Mem: 128000 124072 3928 20956 50004 43512
> -/+ buffers/cache: 30556 97444
> Swap: 258008 14192 243816
>
> Look .. it has 90MB free ram available and it chooses to swap out
> unused pages.

No, there's 4M of _completely_ free RAM, and alot of RAM being used for disk
buffers. The VM system thinks that disk is more likely to be referenced soon
than the memory it swapped out, so it prefers to keep them in RAM.

> This is great .. until I have to swap them back in again
> at ~ 1MB/s.

How fast can you replace the disk pages that are in cache if they weren't there?

> I need those pages infrequently, but more frequently than
> I need fresh ram.

Yes, but not as frequently as you're using that disk cache, so without the
swap you will be waiting on disk _more_.

A typical machine has a lot of processes that will sit unused for days or
weeks - a small amount of swap means that you get more RAM, usually for
cache. On my main work machine, 34 of 86 processes are essentially completely
swapped out - gettys on unused VCs, tcsh processes in xterms I haven't
touched in ages, a couple GNOME apps that are buried beyond everything.
Without that 17M of RAM that the swap buys me, this machine would be a lot
less responsive. Yes, if I suddenly started typing in one of those windows
there would be a second of delay while it got swapped back in, but if I
didn't have disk cache it would delay every time I ran "ls".

-Mitch

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.348 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site