Re: dynamically allocating chunks from shared memory

From: Markus Wanner <markus(at)bluegap(dot)ch>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, 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:55:59
Message-ID: 4C604F3F.1060002@bluegap.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/09/2010 08:49 PM, Bruce Momjian wrote:
> Markus Wanner wrote:
>> That's what my patch allows you to do, yes. Currently you are bound to
>> pre-allocate shared memory at startup. Or how would you allocate small
>> chunks from shared memory at the moment?
>
> We don't --- we allocate it all at startup.

Exactly. And that's the difference to a thread-based approach. The
downside of it is that you need to know in advance how much shared
memory each of the subsystems is going to need. On the upside is the
certainty, that you already have the memory allocated and cannot run out
of it. You just have what you have.

(Note that you could do that as well with the thread-based approach, if
you want. Most other programs I know don't choose that approach, though,
but instead try to cope with OOM).

Regards

Markus

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-08-09 18:56:11 Re: host name support in pg_hba.conf
Previous Message Bruce Momjian 2010-08-09 18:50:45 Re: dynamically allocating chunks from shared memory