From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e9baf10a5806cc9d X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-02-25 20:17:52 PST Path: gmd.de!newsserver.jvnc.net!news2.cac.psu.edu!news.pop.psu.edu!ra!cs.umd.edu!eff!news.kei.com!sol.ctr.columbia.edu!caen!batcomputer!munnari.oz.au!foxhound.dsto.gov.au!fang.dsto.gov.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!andrewr From: andrewr@itd.adelaide.edu.au (Andrew Rutherford) Newsgroups: comp.unix.osf.osf1 Subject: Re: Swap space full problems Date: 24 Feb 1994 07:17:10 GMT Organization: The University of Adelaide Distribution: world Message-ID: <2khk9m$nms@huon.itd.adelaide.edu.au> References: <2jgkk3$pqd@decuk.uvo.dec.com> <2jh8je$fd@usenet.pa.dec.com> <2ju8pj$qlg@huon.itd.adelaide.edu.au> <2k0gel$gkj@krishna.cs.umd.edu> NNTP-Posting-Host: iagu.itd.adelaide.edu X-Newsreader: TIN [version 1.2 PL2] 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 ! */