Re: dynamically allocating chunks from shared memory

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Markus Wanner <markus(at)bluegap(dot)ch>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dynamically allocating chunks from shared memory
Date: 2010-08-09 18:45:53
Message-ID: AANLkTimQk=KK4hxP3ufbm1VOOUfOmRZYEx+txCJAh4T7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 9, 2010 at 2:28 PM, Markus Wanner <markus(at)bluegap(dot)ch> wrote:
> Another issue to be discussed would be the limits of sharing free memory
> between subsystems. Maybe we even reach the conclusion that we absolutely
> *want* fixed maximum sizes for every single subsystem so as to be able to
> guarantee a certain amount of multi-xact or SLRU entries at any point in
> time (otherwise one memory hungry subsystem could possibly eat it all up
> with another subsystem getting the OOM error when trying to allocate for its
> very first entry).

Yeah, I think that's a real concern. I think we need to distinguish
memory needs from memory wants. Ideally, we'd like our entire
database to be cached in RAM. But that may or may not be feasible, so
we page what we can into shared_buffers and page out as necessary to
make room for other things. In contrast, the traditional malloc()
approach doesn't give you much flexibility: if it returns NULL, you
pretty much have to fail whatever operation you were trying to
perform. For some things, that's OK. For other things, it's not.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-08-09 18:47:56 host name support in pg_hba.conf
Previous Message Markus Wanner 2010-08-09 18:39:57 Re: dynamically allocating chunks from shared memory