Re: [GENERAL] ShmemAlloc maximum size - Mailing list pgsql-general

From Julien Rouhaud
Subject Re: [GENERAL] ShmemAlloc maximum size
Date
Msg-id 20170223195519.GA10384@nol.local
Whole thread Raw
In response to [GENERAL] ShmemAlloc maximum size  ("hari.prasath" <hari.prasath@zohocorp.com>)
List pgsql-general
On Thu, Feb 23, 2017 at 08:17:54PM +0530, hari.prasath wrote:
> I am trying to get some 15MB of shared memory using ShmemAlloc.
>
> Cross checked all my kernal variables set in OS level and also in postgresql.conf.
>
> Cant able to get the required memory(15MB) but if i try with some small memory(1MB), its working fine.
>
> Am i missing something.?

Assuming you're talking about some C extension, you have to request in
_PG_INIT() the amount of shmem you'll need, with RequestAddinShmemSpace().

You can see an example in pg_stat_statements.c how it's done (_PG_INIT() and
pgss_shmem_startup()).

Asking a small amount probably works because some shared memory is requested
but not totally used as soon as the server starts.

Regards.

--
Julien Rouhaud
http://dalibo.com - http://dalibo.org


pgsql-general by date:

Previous
From: Sandeep Thakkar
Date:
Subject: Re: [GENERAL] Building PostgreSQL 9.6devel sources with MicrosoftVisual C++ 2015?
Next
From: Moreno Andreo
Date:
Subject: [GENERAL] echo