Re: Out of memory kernel deat

Jon Tombs (jon@gte.esi.us.es)
Mon, 12 May 1997 11:11:39 +0200 (MET DST)


Thomas Koenig said:
> I'd propose a fairly simple solution: send a SIGURG signal to
> whatever process has a signal handler for it installed.
>
> This process could then do whatever it wants to, such as allocating
> more swap, killing off an errant process or send an E-Mail to
> the admin to go out and buy more RAM.
>
> Policy is for userland.

My previous reply doesn't seem to have made it to the list.

I proposed the following algorithm for oem situation.

Igonoring process 1, give "death points" to each process, for the following
attributes.

X points for every page rss
-Y points for every second of execution time
Z points for not having uid=0
Z/2 points for not having euid=0

The process with the biggest score gets killed.

The important processes, tend to be:
owned by root
old (started at boot).

The factors X,Y,Z should be settable via /proc, for those that always work
as root, the might set Z very small. If the above tends to kill the Xserver,
setting X smaller, and Y larger will always kill a younger process and protect
the system daemons and server (which is always older than the first X app).
Setting X,Y,Z above you can get the BSD, or SunOS behaviour.

There might me other factors to include, but they don't occur to me at the
moment.

I think the above is a solution in the spirit of linux. If we use a fixed
set of rules to kill a process, somebody will always be able to produce a
situation that kills an important process. Let them change the weighting.

Jon.

-- 
Jon. <jon@gte.esi.us.es, http://www.esi.us.es/~jon>