Re: Memory leak of SMgrRelation object on standby

From: 邱宇航 <iamqyh(at)gmail(dot)com>
To: Jingtang Zhang <mrdrivingduck(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Memory leak of SMgrRelation object on standby
Date: 2025-09-09 03:58:51
Message-ID: 838F25BF-B10A-4A3E-94F9-1090E477615E@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 2025年8月26日 11:59,Jingtang Zhang <mrdrivingduck(at)gmail(dot)com> 写道:
>
> Hi~
>
>> I purpose a patch which calls smgrdestroyall() when redo each
>> XLOG_CHECKPOINT_ONLINE, so that it can keep the same frequency of calling
>> smgrdestroyall() as background processes on primary. I don't call it for
>> XLOG_CHECKPOINT_SHUTDOWN because the process is about to exit so that the
>> memory will go soon, and don't call it for XLOG_CHECKPOINT_REDO because it
>> seems to be a place holder only.
>
>
> Oops. When redo XLOG_CHECKPOINT_SHUTDOWN, smgrdestroyall should also be
> called, since the startup may not exit on standby.
>
> The patch is updated.
>
> —
> Regards, Jingtang
>
> <v4-0001-Fix-SMgrRelation-object-memory-leak-during-startup-r.patch>

LGTM.

Best regards,
Yuhang Qiu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-09-09 04:00:15 Re: pg_restore --no-policies should not restore policies' comment
Previous Message Michael Paquier 2025-09-09 03:58:32 Re: Remove traces of long in dynahash.c