Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Apr 2005 05:24:15 -0700 (PDT)
From:      "ALeine" <aleine@austrosearch.net>
To:        killing@multiplay.co.uk
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kernel killing processes when out of swap 
Message-ID:  <200504121224.j3CCOFXL019177@marlena.vvi.at>

next in thread | raw e-mail | index | archive | help
killing@multiplay.co.uk wrote: 

> Just had a problem with a box where it looks like it ran out of
> swap due to a problem process, not a problem. The problem was that it
> seems the kernel on detecting this starts killing off seeming random
> processes, the first one being sshd hence making the machine inaccessible.
> 
> So the question is: Does the kernel kill random processes when
> out of swap or does it kill any processes that require more memory when
> out of swap? Which leads to the question would it not be more
> sensible to kill off the largest process first as its more than likely that
> it is responsible for the problem?

This procedure is not random, it indeed looks for the largest process and
then kills it. It keeps repeating this procedure until the memory starvation
problem is solved. You obviously are not running X on that machine, otherwise
you would see that X would get killed before sshd. When you're out of swap,
you're also out of luck if sshd is among the largest processes on your
machine. Having a flag to tag processes as vital to prevent them from getting
killed (or to give them lower next-to-be-killed priority so that all non-vital
processes get killed first) when you run out of swap would be a useful feature,
what do you guys think?

ALeine
___________________________________________________________________
WebMail FREE http://mail.austrosearch.net 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200504121224.j3CCOFXL019177>