Re: Out Of Memory in v. 2.1

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Tue, 6 Oct 1998 21:38:08 +0200 (CEST)


On 6 Oct 1998, Stefan Monnier wrote:
> >>>>> "Carlos" == Carlos Morgado <l39801@alfa.ist.utl.pt> writes:
> > On Mon, Oct 05, 1998 at 09:18:15AM -0400, Stefan Monnier wrote:
> >> patterns and kills the faster-growing process.
> > Then a program could slowly allocate slow memory chunks till it allocates
> > all the available memory and the kernel kills some inocent process that just
>
> Yes. I don't think there is a perfect solution. Only a set of heuristics
> such as
> - avoid processes that have direct hardware acvcess
> - avoid root processes
> - avoid daemon processes (uid < 100 or somesuch)
> - avoid old processes
> - prefer faster-growing processes
> - prefer ugly memory-hogs
> - ...
>
> I don't know yet what Rik uses as heuristics.

I use process size (RSS), divided by the square root
of age and the square root of the square root of CPU
time used (both in 8 second intervals).

Then there are bonusses for suid, root and other
stuff. IOPL processes never get any points, so
they won't be killed.

If you want to know all details, please get the
patch from my homepage and read it -- Claus and
I went into great length to make it readable for
first-time kernel hackers as well...

> But of course the very first thing you want to do is to make sure
> that OOM will not kill your whole system.

That's the idea, the rest is somewhat of a luxury;
however, since the OOM code path is hardly ever
taken, we can afford ourselves the luxury of a
full-featured algorithm...

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+

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