Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: andrewr@itd.adelaide.edu.au (Andrew Rutherford)
Subject: Re: Swap space full problems
Date: 24 Feb 1994 07:17:10 GMT	[thread overview]
Message-ID: <2khk9m$nms@huon.itd.adelaide.edu.au> (raw)
In-Reply-To: 2k0gel$gkj@krishna.cs.umd.edu

In article <2ju8pj$qlg@huon.itd.adelaide.edu.au> I wrote:

+ 	On the overcommit machine, it allocated more memory than existed,
+ tried writing to a page of it, and the kernel killed it. System returns
+ to normal after a five minute hang.
+
+ 	On the eager allocation machine, it chewed up all memory it could,
+ then the malloc's must have started failing, but it didn't die as a result
+ of it - we wouldn't have known what the problem was if not for the other
+ machine - the only way out was the panic button, as we couldn't run
+ anything else as there was no memory availible.

In article <2k0gel$gkj@krishna.cs.umd.edu> Harry Mantakos wrote:

: I don't think this is a typical situation. The process on the second machine
: should have exit()'ed after a failed malloc, sort of sounds like someone 
: didn't check a malloc() return value.

	I know, it's a bug. In DEC's code, no less, but it's been long
fixed now. An SNMP agent that when queried by a specific machine went
rogue. The important thing was that the lazy swap machine recovered
from a runaway process while the eager alloaction machine didn't
recover, and it was that I was trying to demostrate, not the lousy
programming style of someone. After all, eventually someone is going to
make a mistake on your machine, and I'd like the machine to have some
chance of recovery.

: With the more traditional allocation scheme, swap is reserved as memory 
: is allocated, this insures that you will only run out of swap when memory 
: is being allocated, as in when a process is first starting up or when it 
: is doing a malloc(). With deferred swapping the system will honor requests 
: for any amount of virtual memory, and swap will be assigned only as those 
: allocated pages of memory are actually accessed. 

	The point here is that it's reserving space for the shared
libraries, specifically the C shared library, since everyone uses it.

: To check this out, I turned on deferred swapping on an alpha here
: (running OSF/1 V1.2) and ran a few instances of a process that malloc's 
: a 50 meg chunk, then goes through and touches each page one by one. With 
: 80 meg of swap, the system cheerfully promised out 200 meg of virtual 
: memory. When the system started running out of swap (as the processes 
: started accessing their promised pages), the machine turned into a 
: battleground, my editor sessions croaked, shells quit, and windows started 
: disappearing. With deferred swapping turned off, the processes that were 
: eating up all the memory would have just failed on the malloc().

	Did you actually try it with eager allocation? I think you'd
find the machine ran just as slowly, it still has to do a _lot_ of
swapping (cf: run /usr/etc/chill on a SunOS machine and tell me how
fast the machine goes). I am suprised that your windows, etc, started
to vanish - one would think that only processes writing to memory they
hadn't already written to would be falling over, and in my experience
nothing else is actually doing anything when the critical swap space
point is reached with a runaway process, as the system is so busy
swapping. I must have been incredibily lucky, but I've only ever had the
runaway process die. I would expect any session's I'm actively doing
memory "intensive" things (ie, including a new file into the edit buffer)
at the time to die, but it hasn't actually happened to me yet. I probably
got saved by giving up and not fighting the system and just sitting back
and waiting for it to recover.

	I'd also note that (1) a lot of the wierd behaviour of killing
things changed in the upgrade from 1.2 to 1.3, and (2) the two machines
I mentioned earlier weren't running either 1.2 or 1.3. :-)

: So, of course it's a trade-off. With deferred swapping you can use the swap

	I agree, there is definatly a trade-off. You lose some of your
system security by going to lazy mode, but it does allow you to take the
machine well past where it would otherwise go. There are also specific,
limited cases with runaway programs where it lazy systems will recover
where eager systems won't, but in general it's just a different way
your machine gets screwed. :-)

	Basically, I'd advocate lazy in all cases except absolute
guarantee required systems where development isn't taking place, in
which case eager is definatly the way to go.

Cya all,
	Andrew.

/*
 * Andrew Rutherford                andrewr@iagu.itd.adelaide.edu
 * +61 8 303 5669            Real Programmers always confuse Christmas and
 * Room 1060, Adelaide Uni      Halloween because OCT 31 == DEC 25 !
 */


  parent reply	other threads:[~1994-02-24  7:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-02-01 22:38 Swap space full problems Don Katz
1994-02-02 17:26 ` Darcy Semeniuk
     [not found]   ` <2iq2od$l3f@scratchy.reed.edu>
1994-02-11 19:00     ` Andy Brown
1994-02-11 19:49       ` System Janitor
1994-02-12  0:41       ` Gail L. Grant
1994-02-16 23:04         ` Andrew Rutherford
1994-02-17 19:27           ` Harry Mantakos
1994-02-18  5:54             ` Wuxu Peng
1994-02-22 11:00               ` anthony baxter
1994-02-24  7:17             ` Andrew Rutherford [this message]
  -- strict thread matches above, loose matches on Subject: below --
1994-02-14 19:41 Don Katz
1994-02-15 16:13 ` hooft
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox