Re: Pre-allocation of shared memory ...

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jon Lapham <lapham(at)extracta(dot)com(dot)br>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Pre-allocation of shared memory ...
Date: 2003-06-12 15:05:12
Message-ID: 200306121505.h5CF5Cb21789@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


What really kills [:-)] me is that they allocate memory assuming I will
not be using it all, then terminate the executable in an unrecoverable
way when I go to use the memory.

And, they make a judgement on users who don't want this by calling them
"paranoid".

I will add something to the docs about this.

---------------------------------------------------------------------------

Tom Lane wrote:
> Jon Lapham <lapham(at)extracta(dot)com(dot)br> writes:
> > Just curious. What would a rationally designed OS do in an out of
> > memory situation?
>
> Fail malloc() requests.
>
> The sysctl docs that Andrew Dunstan just provided give some insight into
> the problem: the default behavior of Linux is to promise more virtual
> memory than it can actually deliver. That is, it allows malloc to
> succeed even when it's not going to be able to actually provide the
> address space when push comes to shove. When called to stand and
> deliver, the kernel has no way to report failure (other than perhaps a
> software-induced SIGSEGV, which would hardly be an improvement). So it
> kills the process instead. Unfortunately, the process that happens to
> be in the line of fire at this point could be any process, not only the
> one that made unreasonable memory demands.
>
> This is perhaps an okay behavior for desktop systems being run by
> people who are accustomed to Microsoft-like reliability. But to make it
> the default is brain-dead, and to make it the only available behavior
> (as seems to have been true until very recently) defies belief. The
> setting now called "paranoid overcommit" is IMHO the *only* acceptable
> one for any sort of server system. With anything else, you risk having
> critical userspace daemons killed through no fault of their own.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-06-12 15:19:51 Re: Pre-allocation of shared memory ...
Previous Message Jon Lapham 2003-06-12 14:52:46 Re: Pre-allocation of shared memory ...