Re: Retain dynamic shared memory segments for postmaster lifetime

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Retain dynamic shared memory segments for postmaster lifetime
Date: 2014-01-28 05:30:56
Message-ID: CA+HiwqG1jMbE4HMmTP7QM3pDWHLEf64R54d4kzpZD68ST0fL0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 28, 2014 at 1:41 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Mon, Jan 27, 2014 at 7:48 PM, Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
>> On Mon, Jan 13, 2014 at 2:50 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>> I have extended test (contrib) module dsm_demo such that now user
>>> can specify during dsm_demo_create the lifespan of segment.
>>
>> Applied dsm_keep_segment_v1.patch and dsm_demo_v1.patch.
>> Got the following warning when I tried above example:
>>
>> postgres=# select dsm_demo_create('this message is from session-new', 1);
>> WARNING: dynamic shared memory leak: segment 1402373971 still referenced
>> WARNING: dynamic shared memory leak: segment 1402373971 still referenced
>> dsm_demo_create
>> -----------------
>> 1402373971
>> (1 row)
>
> Thanks for verification.
> The reason is that resource owner has reference to segment till commit time
> which leads to this warning. The fix is to remove reference from
> resource owner when user calls this new API dsm_keep_segment, similar
> to what currently dsm_keep_mapping does.
>
> Find the updated patch to fix this problem attached with this mail.
>

Thanks, the warnings are gone.

--
Amit

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-01-28 05:48:14 Re: Why conf.d should be default, and auto.conf and recovery.conf should be in it
Previous Message David Fetter 2014-01-28 05:29:08 Re: Fix comment typo in /src/backend/command/cluster.c