Re: Memory hogs

Bernd Paysan (bernd.paysan@gmx.de)
Mon, 19 Jul 1999 00:36:10 +0200 (MEST)


On Fri, 16 Jul 1999, Rik van Riel wrote:

> Once you're completely out of memory, you're too late. We
> can simply start killing once we get very very near...

My algorithm idea is to have two states: idle, and warned. When memory
gets tight, give a warning shot (SIGQUIT), and change to warned. When the
memory gets even tighter (there must be a second threshold), give a final
shot (SIGKILL). Just like these zap guns they use at Stargate SG1 ;-).

Rik's code has the limit numbers as kernel magic numbers, I'd like more to
have a /proc/sys/vm/ entry for them. But that can wait until I get the
thing working.

With a useful setup, tight memory is so far from ordinary operation, that
all this really should never happen. This should only happen when there is
really a malicious program attacking the machine (or a program that has
gone wild). If it really happens during normal operation, add a new swap
partition, or better buy more RAM.

Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/

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