Re: On the issue of low memory situations

From: Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Date: Sun Mar 19 2000 - 11:59:51 EST


David Weinehall <tao@acc.umu.se> said:

[...]

> 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.

OOM ==> killall. Great. I'd prefer the most stupid heuristic for finding
hogs anyday.

> 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...

It is very easy to implement, kernelwise: Count how much is free, if <
threshold, kill(3) all processes. Problem is, very few (if any at all)
programs are prepared to handle this, let alone sanely. It is very easy to
decree that "non essential memory allocations should be shed now", it is
quite another to really do so, one application at a time, for a full
distribution. And you'll find out that the oportunities to do this are
severely limited in most programs, unless they are redesigned from the
ground up. Even deallocating memory that won't be used anymore isn't done
right as it stands today (memory leaks anyone? ;). Perhaps if everything
uses garbage collection you could force garbage collection on SIGDANGER,
but that is less (time-average) than what you get by deallocating when not
using anymore.

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

- 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:27 EST