Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Jan 2008 12:31:07 +0100
From:      Kris Kennaway <kris@FreeBSD.org>
To:        Igor Mozolevsky <igor@hybrid-lab.co.uk>
Cc:        =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= <des@des.no>, freebsd-current@freebsd.org, Robert Watson <rwatson@freebsd.org>, Jason Evans <jasone@freebsd.org>
Subject:   Re: sbrk(2) broken
Message-ID:  <477E18FB.3040205@FreeBSD.org>
In-Reply-To: <a2b6592c0801040318s9986f10u40cf725bc96304c6@mail.gmail.com>
References:  <477C82F0.5060809@freebsd.org> <863ateemw2.fsf@ds4.des.no>	<20080104002002.L30578@fledge.watson.org>	<a2b6592c0801040241l598ea9b7h57ad6889a1eccd3@mail.gmail.com>	<86bq81c12d.fsf@ds4.des.no> <a2b6592c0801040318s9986f10u40cf725bc96304c6@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Igor Mozolevsky wrote:
> On 04/01/2008, Dag-Erling Smørgrav <des@des.no> wrote:
> 
>> For the same reason as it has for the last 20 years or so: memory
>> overcommit, which means that malloc() allocates address space, not
>> memory.  Actual memory is allocated on-demand when the address space is
>> used (read from or written to).  If there is no RAM left and none can be
>> freed by swapping out, the process gets killed.  The process that gets
>> killed is not necessarily the memory hog, it is merely the process that
>> is unlucky enough to touch a new page at the wrong moment, i.e. when all
>> RAM and swap is exhausted *or* everything in RAM is wired down and
>> unswappable.
> 
> Broadcasting SIGDANGER would be a much better option; followed by
> SIGTERM to the memory hogger (to allow for graceful termination) and
> only then SIGKILL. I can imagine a few (legitimate) scenarios when a
> user process would want to hog as much RAM as possible...

Do everyone a favour and research the topic in the archives, please. 
Another thread on the subject will just waste everyone's time.

Kris




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