[lkml]   [1997]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Out of memory kernel deat
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

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

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

 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean