[H-GEN] What size swap space is optimum?

Andrae Muys amuys at shortech.com.au
Mon Apr 23 20:54:51 EDT 2001


[ Humbug *General* list - semi-serious discussions about Humbug and  ]
[ Unix-related topics.  Please observe the list's charter.           ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]

Jason Henry Parker wrote:
> 
> [ Humbug *General* list - semi-serious discussions about Humbug and  ]
> [ Unix-related topics.  Please observe the list's charter.           ]
> [ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]
> 
> On Tue, Apr 24, 2001 at 07:33:45AM +1000, Webmaster wrote:
> 
> > OK, thanks for the pointers. But I'd now like to raise the original
> > issue which promted my inquiry. When I'm surfing the Net and get
> > more than two Netscape screens running, the system often locks up in
> > 'disk-thrashing mode' - the HDD sits churning away in an endless loop
> > - and I've let it go as long as ten minutes before hitting reset. I
> > made the assumption that this was due to insufficient memory (real
> > or virtual - 32MB RAM, 32MB swap partition) and have followed this
> > through.
> 
> I have 32MB of RAM also.  At one point the machine was running netscape;
> I found it pretty painful.  My experience suggests that you do not have
> enough swap space (if increasing the amount of RAM is not an option).  I
> have a 128MB swap partition and well, I can cope.  With that much RAM it
> is about all you can do, modulo removing unneeded services, and so on.
> 
> > Further investigation suggests that this event occurs when Java is
> > invoked, and I've now seen enough snide comments about Netscape (it
> > really is a dreadful piece of software) to prompt inquiries in this
> > direction. Even with low memory and lots of swapping, any instruction
> > sequence should surely proceed to completion this side of Xmas -
> > correct?
> 
> Correct, *but* it may take a very long time if you have very little
> virtual memory.
> 
Actually not necessarilly correct.  Most OS's with virtual memory
subsystems can suffer from an OOM condition called thrashing.  I suspect
this is what you are suffering.  Effectively what happens is that there
is so little spare memory available that processes spend their entire
time-slice in page faults trying to swap in enough of their pages to
execute, in the process ensuring that the next process on the run queue
is swapped out and will likewise be forced to spend it's time-slice
swapping.

Ultimately the only solution to the problem is to provide more memory,
or to use less.  However you may see some improvements by increasing the
amount of swap (allows the OS more flexibility, reducing page-fault
times), and by splitting swap partitions across multiple disks/off data
disks (reducing IO contention, reducing page-fault times).

Andrae Muys

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list