kernel killing processes when out of swap

Nick Barnes Nick.Barnes at
Tue Apr 12 07:06:48 PDT 2005

At 2005-04-12 13:52:59+0000, Vivek Khera writes:

> > 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?
> >
> so when this largest process is your production database server for 
> your e-commerce site, what will you change your recommendation to be?
> basically, there is no "right" choice of process to kill.  a machine 
> that is out of resources is just a bad situation, and the right thing 
> is to try to avoid getting there with careful monitoring and planning.

The right choice is for mmap() to return ENOMEM, and then for malloc()
to return NULL, but almost no operating systems make this choice any

Nick B

More information about the freebsd-stable mailing list