Re: SnapBuildSerialize function forgot pfree variable ondisk_c

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: 范孝剑(康贤) <funnyxj(dot)fxj(at)alibaba-inc(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: SnapBuildSerialize function forgot pfree variable ondisk_c
Date: 2020-11-06 03:22:19
Message-ID: CAA4eK1KWhmHxuqy1huE8sUnQ+4qrH_WnVcab5MEuuOwbyuiVqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Nov 5, 2020 at 2:06 PM 范孝剑(康贤) <funnyxj(dot)fxj(at)alibaba-inc(dot)com> wrote:
>
> Hi all,
> When I tested logical decoding, I found that walsender process memory usage grow very high, by debugging, I found SnapBuildSerialize palloc memory for variable ondisk_c, but don't pfree it at last.
>

By looking at code, it is clear that it is good to free the memory
allocated for variable ondisk_c.

> So when master LogStandbySnapshot() too frequently, walsender memory will grow very high and OOM finally.
>

Is there any particular scenario where you are seeing this behavior?
Do you have any reproducible test case? Have you confirmed that after
freeing that memory your problem is solved? It is not clear to me why
other users of Logical Replication are not facing this issue?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Bille 2020-11-06 14:28:09 Re: BUG #16703: pg-dump fails to process recursive view definition
Previous Message Thomas Munro 2020-11-06 03:18:21 Re: BUG #16704: Segmentation Problem - SSL SYSCALL error: EOF detected