Re: On the issue of low memory situations

From: David Weinehall (tao@acc.umu.se)
Date: Sat Mar 18 2000 - 18:41:50 EST


On Fri, 17 Mar 2000, Nicholas Vinen wrote:

>
> On Fri, 17 Mar 2000, Linda Walsh wrote:
>
> > I haven't read through this whole thread, so this may have been
> > suggested, but why not have a new signal "SIGNMEM". Can't be caught but
> > can be ignored. Default is to take the signal and terminate the program
> > that faulted. If ignored, put process to sleep until the memory request
> > can be satisfied. Then something like 'X' or apache could ignore, while
> > 'gcc' would just die.
>
> Well, it might even be useful to be able to catch it. Example: 'X' gets
> a SIGNMEM. It responds by freeing any memory it might be using for bitmap
> caches, font glyph caches, anything unnecessary. When it returns from the
> signal, the system then has enough memory free to fulfill the request and
> continue the program. 'X' may have also set a flag somewhere when it
> caught this signal to tell itself at the first opportunity to shut down
> and print "low memory: aborting" if this was a desired behaviour. Better
> than a crash huh?
> Overall an excellent suggestion I think.

AIX implements something akin to this. When memory is running low, it
sends SIGDANGER to all processes. Those who doesn't trap it, dies. Those
who trap it can shut down gracefully or, if they are important daemons,
stay alive.

I suggest we make some research on how they have implemented it. It might
be the best solution. The only drawback is that we need all important
userspace programs (the ones that must survive or shut down properly) to
trap SIGDANGER. But this is an issue for v2.5 anyway, so...

/David Weinehall
  _ _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander \\
// Project MCA Linux hacker // Dance across the winter sky //
\> http://www.acc.umu.se/~tao/ </ Full colour fire </

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:25 EST