Re: Memory leak of SMgrRelation object on standby - Mailing list pgsql-hackers

From Jingtang Zhang
Subject Re: Memory leak of SMgrRelation object on standby
Date
Msg-id 32E74D1F-30A0-477C-998A-C83FD81597AF@gmail.com
Whole thread Raw
In response to Re: Memory leak of SMgrRelation object on standby  (Jingtang Zhang <mrdrivingduck@gmail.com>)
List pgsql-hackers
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


Attachment

pgsql-hackers by date:

Previous
From: Alexandra Wang
Date:
Subject: Re: SQL:2023 JSON simplified accessor support
Next
From: Ajin Cherian
Date:
Subject: Re: Improve pg_sync_replication_slots() to wait for primary to advance