Re: Pre-allocation of shared memory ... - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Pre-allocation of shared memory ...
Date
Msg-id 878ys7m941.fsf@stark.dyndns.tv
Whole thread Raw
In response to Re: Pre-allocation of shared memory ...  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Pre-allocation of shared memory ...  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:

> The policy they're calling "paranoid overcommit" (don't allocate more
> virtual memory than you have swap) is as far as I know the standard on
> all Unixen other than Linux; certainly it's the traditional behavior.

Uhm, it's traditional for Unixen without extensive shared memory usage like
SunOS 4. But it's not nearly as standard as you say. 

In fact Linux wasn't the first major Unix to behave this way at all. As far as
I know, that honour belongs to AIX. Not coincidentally, one of the first
Unixen to have shared libraries. Hence the AIX invention of SIGDANGER which
told a process its death was imminent.

On AIX the heuristic was to kill the largest process in order to clear up the
most memory -- which had a nasty habit of picking the X server to kill, which
of course, well, it cleared up lots of memory... I think they "fixed" that by
changing the heuristic to kill the *second* biggest process.

I think you'll find this overcommit issue affects many if not most Unixen.
There's a bit of a vicious circle here, a lot of software now have the habit
of starting off by mallocing huge chunks of memory that they never need
because "well the machine has virtual memory so it doesn't cost anything".

-- 
greg



pgsql-hackers by date:

Previous
From: Dennis Björklund
Date:
Subject: sql_ascii
Next
From: Sean Chittenden
Date:
Subject: Re: CVS -Tip compile issue -- FreeBSD 4.8