MiniProposal (Re: Memory overcommitting (was Re: http://www.redhat.com/redhat/))

Adam D. Moss (adam@uunet.pipex.com)
Thu, 20 Feb 1997 13:40:13 GMT


Theodore Y. Ts'o writes:
> One can imagine systems where processes are killed by the kernel when
> you run out of memory. Many Unix systems in fact do play games like
> this, including the original BSD systems, and even IBM's AIX will kill
> processes when memory is tight.

Last I heard, this is what Linux does also. And, at least in
preference to the old behaviour of disappearing up its own behind, so
to speak :-) it seems to work okay.

The only (okay, it's quite a biggie) fly in the ointment is that when
faced with a no-memory situation, Linux seems to kill the process with
the most resources, which in most cases for me at least is X Windows -
which also in effect kills most of whatever I was working on. Sigh.

I propose that the following relatively simple procedure be evaluated;
that the victim-selection procedure be weighted to be somewhat less
likely to kill a process with child processes, and MORE likely to kill
a process which is itself a deeply-nested child.

IE the killability of a pid is *basically* something like
(weighting_constant * vm_pages_of_pid(pid)) /
(number_of_descendants(pid) - number_of_ancestors(pid))
and the pid with the highest killability is destroyed.

Theoretically this should stand a better chance of leaving daemons and
server-processes intact, with a proviso or two.

Constructive criticism? :-)

Cheers,
--Adam
Adam D. Moss / UUNET Consulting / adam@uunet.pipex.com
UUNET / 332 Science Park / Milton Road / Cambridge CB4 4BZ
/ England / Voice +44 (0)1223 250100 / http://consult.uu.net/
====-==-=-=--=--=---=---=-------- ---- --- -- -- -- - - - - - - -
Personal WWW Thing: http://www.worldserver.pipex.com/home/adam/
(AllOpinionsAreMyOwnAndNotNecessarilyThoseOfUUNET) / :Team Torvalds: