From: Mike Jagdis (jaggy@purplet.demon.co.uk)
Date: 01/26/93


From: jaggy@purplet.demon.co.uk (Mike Jagdis)
Subject: Re: Freeze up on X
Date: Tue, 26 Jan 1993 21:43:00 +0000


* In message, <FOX.93Jan23083823@graphics.nyu.edu>, David Fox said:

DF> The real allocation occurs when the allocated pages are written
DF> to, and there is no equivalent to malloc returning NULL when
DF> there is insufficient memory to allocate a page.

I believe AIX 3.1 uses the same type of delayed page allocation and
introduced a new signal, SIGDANGER, which is sent to processes that allocate
pages after the free pool falls below a certain threshold.

  Of course, programs would need to be written to handle SIGDANGER but
perhaps a fair bit could be gained by having the malloc library module
handle it unless otherwise overridden? Just have malloc register a handler
on first invocation if none already exists. When the handler is triggered it
searches for pages which are completely unused and unmaps them. The
effectiveness is, of course, dependent on fragmentation.

  It would be nice to have processes killed on memory exhaustion too though.
I've had g++ go completely awol before now. Adding swap wasn't a good idea,
I gave it 70Mb before I realised that!

  (Incidentally, the swap code in 99p4 is pretty stable. 2 swap partitions
plus 3 swap files, one on a minix fs, two on an ext fs, all attached,
flooded and finally removed with no ill effects - other than my heart!)

                                Mike