Re: dynamically allocating chunks from shared memory

From: Markus Wanner <markus(at)bluegap(dot)ch>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: 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-07-26 17:50:48
Message-ID: 4C4DCAF8.5000200@bluegap.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 07/26/2010 07:16 PM, Robert Haas wrote:
> Of course, there are other parts of the system (a whole bunch of them)
> that used shared memory also, and perhaps some of those could be
> modified to use the dynamic allocator as well. But they're getting by
> without it now, so maybe they don't really need it. The SLRU stuff, I
> think, works more or less like shared buffers (so you have the same
> set of issues) and I think most of the other users are allocating
> small, fixed-size chunks.

Yeah, I see your point(s).

Note however, that a thread based design doesn't have this problem *at
all*. Memory generally is shared (between threads) and you can
dynamically allocate more or less (until Linux' OOM killer hits you..
yet another story). The OS reuses memory you don't currently need even
for other applications.

Users as well as developers know the threaded model (arguably, much
better than the process based one). So that's what we get compared to.
And what developers (including me) are used to.

I think we are getting by with fixed allocations at the moment, because
we did a lot to get by with it. By working around these limitations.

However, that's just my thinking. Thank you for your inputs.

Regards

Markus Wanner

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2010-07-26 18:09:03 Re: patch (for 9.1) string functions
Previous Message Robert Haas 2010-07-26 17:45:06 Re: patch (for 9.1) string functions