From: harry@cs.umd.edu (Harry Mantakos)
Subject: Re: Swap space full problems
Date: 17 Feb 1994 14:27:17 -0500 [thread overview]
Message-ID: <2k0gel$gkj@krishna.cs.umd.edu> (raw)
In-Reply-To: 2ju8pj$qlg@huon.itd.adelaide.edu.au
In article <2ju8pj$qlg@huon.itd.adelaide.edu.au> andrewr@itd.adelaide.edu.au (Andrew Rutherford) writes:
> 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.
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.
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.
Deferred swapping is more efficient, because pages that are never used
never take up any swap. However the system will make commitments for more
virtual memory than it actually has, and when it actually does run out of
swap, processes will fail on memory accesses rather than just on malloc,
or fork/exec.
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().
So, of course it's a trade-off. With deferred swapping you can use the swap
you have more efficiently (by never reserving swap for pages that never get
accessed). However things are uglier when you actually do run out of swap.
Processes get killed at "random" moments with no chance to exit gracefully
(and maybe clean up after themselves in some fashion). Also, since it
isn't the malloc()s that are failing, the processes that die aren't necessarily
even the ones eating up all the memory.
-harry
------------------------------------------------------------------------------
Spoken: Harry Mantakos Domain: harry@cs.umd.edu UUCP: uunet!mimsy!harry
Phone: 301-405-2750 USPS: U of Maryland, CS Dept., College Park, MD 20742
next prev parent reply other threads:[~1994-02-17 19:27 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 [this message]
1994-02-18 5:54 ` Wuxu Peng
1994-02-22 11:00 ` anthony baxter
1994-02-24 7:17 ` Andrew Rutherford
-- 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