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 1C2328C9-1FA5-4AA5-8929-9EE5966C7246@gmail.com
Whole thread Raw
In response to Re: Memory leak of SMgrRelation object on standby  (邱宇航 <iamqyh@gmail.com>)
List pgsql-hackers
Hi~

> Agree with that. Maybe we can call smgrdestroyall in startup process when
> replaying CHECKPOINT records, just like bgwriter/checkpointer, which free
> all smgr objects after any checkpoint.

That seems reasonable, in that case a startup process would behave just the
same as bgwriter or checkpointer.

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.

—
Regards, Jingtang


Attachment

pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: index prefetching
Next
From: Robert Treat
Date:
Subject: Re: Adding REPACK [concurrently]