Re: Experimental dynamic memory allocation of postgresql shared memory

From: Andres Freund <andres(at)anarazel(dot)de>
To: Aleksey Demakov <ademakov(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Experimental dynamic memory allocation of postgresql shared memory
Date: 2016-06-17 18:31:53
Message-ID: 20160617183153.5n6petzuv6m4lxw2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksey Demakov 2016-06-17 18:32:15 Re: Experimental dynamic memory allocation of postgresql shared memory
Previous Message Aleksey Demakov 2016-06-17 18:23:14 Re: Experimental dynamic memory allocation of postgresql shared memory