Re: Pre-allocation of shared memory ...

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pre-allocation of shared memory ...
Date: 2003-06-12 09:35:17
Message-ID: 33593.199.90.235.43.1055424917.squirrel@www.dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On this machine (RH9, kernel 2.4.20-18.9) the docs say (in
/usr/src/linux-2.4/Documentation/vm/overcommit-accounting ):

-----------------
The Linux kernel supports four overcommit handling modes

0 - Heuristic overcommit handling. Obvious overcommits of
address space are refused. Used for a typical system. It
ensures a seriously wild allocation fails while allowing
overcommit to reduce swap usage

1 - No overcommit handling. Appropriate for some scientific
applications

2 - (NEW) strict overcommit. The total address space commit
for the system is not permitted to exceed swap + half ram.
In almost all situations this means a process will not be
killed while accessing pages but only by malloc failures
that are reported back by the kernel mmap/brk code.

3 - (NEW) paranoid overcommit The total address space commit
for the system is not permitted to exceed swap. The machine
will never kill a process accessing pages it has mapped
except due to a bug (ie report it!)
----------------------

So maybe

sysctl -w vm.overcommit_memory=3

is what's needed? I guess you might pay a performance hit for doing that,
though.

andrew

> > Yeah, I see it in the Mandrake kernel. But it's not in stock 2.4.19,
> > so you can't assume everybody has it.
> >
>
> We had this problem on a recent version of good old Slackware.
> I think we also had it on RedHat 8 or so.
>
> Doing this kind of killing is definitely a bad habit. I thought it had
> it had to do with something else so my proposal for pre-allocation
> seems to be pretty obsolete ;).
>
> Thanks a lot.
>
> Hans

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Srikanth M 2003-06-12 11:20:37 Printing groupClause List
Previous Message Dennis Björklund 2003-06-12 06:53:41 Alter strings that don't belong to the application