Re: Experimental dynamic memory allocation of postgresql shared memory - Mailing list pgsql-hackers

From Aleksey Demakov
Subject Re: Experimental dynamic memory allocation of postgresql shared memory
Date
Msg-id CAFCwUrDhskEMnU+a4T_wmD-LwfsSbXxciLL_5AeLm_JYPVOcwA@mail.gmail.com
Whole thread Raw
In response to Re: Experimental dynamic memory allocation of postgresql shared memory  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sat, Jun 18, 2016 at 12:31 AM, Andres Freund <andres@anarazel.de> wrote:
> On 2016-06-18 00:23:14 +0600, Aleksey Demakov wrote:
>> Finally, it's possible to repeatedly mmap
>> and munmap on portions of a contiguous address space providing
>> a given addr argument for both of them. The last option might, of
>> course, is susceptible to hijacking this portion of the address by an
>> inadvertent caller of mmap with NULL addr argument. But probably
>> this could be avoided by imposing a disciplined use of mmap in
>> postgresql core and extensions.
>
> I don't think that's particularly realistic. malloc() uses mmap(NULL)
> internally.  And you can't portably mmap non-file backed memory from
> different processes; you need something like tmpfs backed / posix shared
> memory / for it.  On linux you can do stuff like madvise(MADV_FREE),
> which kinda helps.

Oops. Agreed.



pgsql-hackers by date:

Previous
From: Aleksey Demakov
Date:
Subject: Re: Experimental dynamic memory allocation of postgresql shared memory
Next
From: Robert Haas
Date:
Subject: Re: Parallelized polymorphic aggs, and aggtype vs aggoutputtype