Re: dynamically allocating chunks from shared memory - Mailing list pgsql-hackers

From Markus Wanner
Subject Re: dynamically allocating chunks from shared memory
Date
Msg-id 4C604F3F.1060002@bluegap.ch
Whole thread Raw
In response to Re: dynamically allocating chunks from shared memory  (Bruce Momjian <bruce@momjian.us>)
List 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


pgsql-hackers by date:

Previous
From: Thom Brown
Date:
Subject: Re: host name support in pg_hba.conf
Next
From: Robert Haas
Date:
Subject: Re: dynamically allocating chunks from shared memory