From: peter@nmti.com (Peter da Silva)
Subject: Re: out of swap -> killing inetd
Date: 1996/07/10 [thread overview]
Message-ID: <4s0h1s$1th@web.nmti.com> (raw)
In-Reply-To: ufivbxlzpc.fsf@microl6.microlise.uucp
In article <ufivbxlzpc.fsf@microl6.microlise.uucp>,
Andrew Gierth <andrewg@microlise.co.uk> wrote:
> >>>>> "Bob" == Bob Vickers <R.Vickers@dcs.rhbnc.ac.uk> wrote:
> Bob> It is almost certainly directly related to your swap mode. In
> Bob> immediate swap mode an error occurs at malloc time if swap space
> Bob> is unavailable, and a well written process can easily recover
> Bob> from this. In deferred mode the malloc succeeds but random
> Bob> errors occur later on when the process tries to write to the
> Bob> memory. This is the penalty you pay for the disc space saving
> Bob> which deferred mode gives you.
> >>>>> "Peter" == Peter da Silva <peter@nmti.com> writes:
> Peter> That's pretty broken. It should be possible to simply allocate
> Peter> memory pretty close to real memory + swap without problems,
> Peter> and then have malloc (actually, sbrk()) and friends generate
> Peter> errors at that point. I don't see why it should ever be
> Peter> necessary to kill random processes.
> Errors can only be reported by sbrk() when swap-space allocation is
> being done early.
If you allocate "swap space", yes. If you allocate "virtual memory", which
is the total of swap plus real memory, then you will never allocate memory
that can't be delivered. But you won't need to lock down swap space for each
block of "real" memory that you use. That is, if I have 64M of RAM and 64M
of swap, "eager" allocation will give me 64M total VM, while "lazy" allocation
will give me some number over 128M of VM allowing for blocks backed by
files (programs, mmaped files). Allocation from a total memory pool will
give me 128M of VM, without losing any programs.
While deferred allocation is a reasonable option, eager allocation forces
you to waste a lot of swap.
Another problem I've found is that if you have two swap partitions of uneven
sizes, it will allocate from them evenly and complain when the smallest is
out. *sigh*
--
Peter da Silva (NIC: PJD2) `-_-' 1601 Industrial Boulevard
Bailey Network Management 'U` Sugar Land, TX 77487-5013
+1 713 274 5180 "Har du kramat din varg idag?" USA
Bailey pays for my technical expertise. My opinions probably scare them
next prev parent reply other threads:[~1996-07-10 4:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-07-08 4:00 out of swap -> killing inetd Steffen Ullrich
1996-07-09 4:00 ` Boyd Roberts
1996-07-09 4:00 ` John Hascall
1996-07-12 4:00 ` Steffen Ullrich
1996-07-09 4:00 ` Bob Vickers
1996-07-09 4:00 ` Peter da Silva
[not found] ` <ufivbxlzpc.fsf@microl6.microlise.uucp>
1996-07-10 4:00 ` Peter da Silva [this message]
1996-07-11 4:00 ` Patrick O'Rourke USG
1996-07-10 4:00 ` Patrick O'Rourke USG
1996-07-10 4:00 ` Andrew Gierth
1996-07-10 4:00 ` Jim Reid
1996-07-09 4:00 ` Randy Kaelber
1996-07-10 4:00 ` Steffen Ullrich
1996-07-23 4:00 ` Brian James O'Connor
-- strict thread matches above, loose matches on Subject: below --
1996-07-13 4:00 Steffen Ullrich
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