[comp.unix.i386] Question about memory

alan@cms2.UUCP (Alan McCain) (04/10/90)

Several weeks ago I saw a posting about a question someone had about the
memory in their system.  They said that when their system goes into swap it
never seems to come out of it completely, even when everyone logs off.  I
have the same situation.  Whey does this happen and can it be fixed?

Email responses are fine.

Thanks!

Alan

root@nebulus.UUCP (Dennis S. Breckenridge) (04/11/90)

In article <156@cms2.UUCP> alan@cms2.UUCP (Alan McCain) writes:
> memory in their system.  They said that when their system goes into swap it
> never seems to come out of it completely, even when everyone logs off.  I
> have the same situation.  Whey does this happen and can it be fixed?
> 
When a paging system fires up a bunch of processes, a "few" pages of 
each process is stored on the swap device to allow the system to grab
the next block of memory from contiguous disk instead of of a fragmented
one. When you are logged off there are several processes still running
namely getty, init, cron, vhandler, etc. This is normal. If memory is
a problem BUY MORE memory! A rule of thumb for the 386 machines running
a UNIX (not Xenix) kernel is 4 megs for o/s and 1 meg for every Simultask
user. If all of your apps are *nix, then take your best guess, you are
safe with 1 meg per user. 

-- 
-----------------------------------------------------------------------------
Dennis S. Breckenridge  (604) 277-7413   dennis@nebulus.uucp           VE7TCP
               EMACS: Eight Megabytes And Constantly Swapping!
-----------------------------------------------------------------------------

pcg@aber-cs.UUCP (Piercarlo Grandi) (04/12/90)

In article <156@cms2.UUCP> alan@cms2.UUCP (Alan McCain) writes:
  Several weeks ago I saw a posting about a question someone had about the
  memory in their system.  They said that when their system goes into swap it
  never seems to come out of it completely, even when everyone logs off.  I
  have the same situation.  Whey does this happen and can it be fixed?
  
  Email responses are fine.

No, no. This is a pet peeve of mine. The System V swapper stinks, as
reported by Bach in his book.

In particular, on a 386, it will still do expansion out swaps. Having done
them, it locks itself itself up waiting for the inswap.

The way to get out of it is usually to just make some process active; this
may well lead to a reshuffle of memory, an thus the swapper will unblock
itself. It helps to kill a process, also.

The real solution is to rewrite the swapper/pager of System V. Tough luck!
-- 
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk

pcg@aber-cs.UUCP (Piercarlo Grandi) (04/12/90)

In article <1990Apr11.024731.11955@nebulus.UUCP> root@nebulus.UUCP (Dennis S. Breckenridge) writes:
  In article <156@cms2.UUCP> alan@cms2.UUCP (Alan McCain) writes:
  > memory in their system.  They said that when their system goes into swap it
  > never seems to come out of it completely, even when everyone logs off.  I
  > have the same situation.  Whey does this happen and can it be fixed?

  If memory is a problem BUY MORE memory! A rule of thumb for the 386
  machines running a UNIX (not Xenix) kernel is 4 megs for o/s and 1 meg for
  every Simultask user. If all of your apps are *nix, then take your best
  guess, you are safe with 1 meg per user. 

The problem is not memory, is the stupidty of the swapper (and who wrote it,
or failed to rewrite it). Look again at your figures: 1 MB per user is also
more or less what all vendors recommend.

Now ask yourself: how many user processes approach 1 MB in *size*? how many
user processes have a working set approaching 1 MB? How much memory should
be left unused to avoid the problems with the System V swapper

The answer to the latter question is ******80-90%******. If you configure
your system with less than 5-10 times the memory required

	(avg.no.of.processes*avg.process.wkg.set)

the System V swapper will make your life miserable.
-- 
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk

root@nebulus.UUCP (Dennis S. Breckenridge) (04/12/90)

pcg@aber-cs.UUCP (Piercarlo Grandi) writes:

>Now ask yourself: how many user processes approach 1 MB in *size*? how many
>user processes have a working set approaching 1 MB? How much memory should
>be left unused to avoid the problems with the System V swapper

What planet are you from? Emacs 1.4 megs, Simultask 1 meg, Kernel 2.3 megs
with networking, oh lets talk about networking code... My machine does not
just sit there with getty's on it. People USE it. I have a varied application
mix for the users and over the period of three years I have found the numbers
work for *ANY* SYSV box. BTW I worked for that SYSV company and had to 
support things like broken swapper. Its a feature not a bug!
-- 
-----------------------------------------------------------------------------
Dennis S. Breckenridge  (604) 277-7413   dennis@nebulus.uucp           VE7TCP
               EMACS: Eight Megabytes And Constantly Swapping!
-----------------------------------------------------------------------------

dwc@cbnewsh.ATT.COM (Malaclypse the Elder) (04/13/90)

In article <1721@aber-cs.UUCP>, pcg@aber-cs.UUCP (Piercarlo Grandi) writes:
> In article <156@cms2.UUCP> alan@cms2.UUCP (Alan McCain) writes:
>   Several weeks ago I saw a posting about a question someone had about the
>   memory in their system.  They said that when their system goes into swap it
>   never seems to come out of it completely, even when everyone logs off.  I
>   have the same situation.  Whey does this happen and can it be fixed?
>   
>   Email responses are fine.
> 
> No, no. This is a pet peeve of mine. The System V swapper stinks, as
> reported by Bach in his book.
> 
> In particular, on a 386, it will still do expansion out swaps. Having done
> them, it locks itself itself up waiting for the inswap.
> 

i don't have a copy of bach's book handy but i am pretty sure that
unix system v release 3 DOES NOT do expansion out swaps.  that is,
if by expansion out swaps, you mean that every process that does an
sbrk() to grow its data region gets swapped out first.  but swapping
CAN occur when an sbrk() is invoked.  if there is insufficient physically
contiguous memory for page tables to accomodate the growth in the
region, the process will roadblock on memory and the swapper awaken
(this is all from memory so some details may be off).

this doesn't mean that the SVR3 swapper doesn't 'stink'.  it could
be better.

danny chen
att!hocus!dwc