Re: pg_walinspect memory leaks
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Jeff Davis <pgsql@j-davis.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-02-14T00:55:37Z
Lists: pgsql-hackers
Hi, On 2023-02-13 15:22:02 -0800, Peter Geoghegan wrote: > More concretely, it looks like GetWALRecordInfo() calls > CStringGetTextDatum/cstring_to_text in a way that accumulates way too > much memory in ExprContext. Additionally, we leak two stringinfos for each record. > This could be avoided by using a separate memory context that is reset > periodically, or something else along the same lines. Everything other than a per-row memory context that's reset each time seems hard to manage in this case. Somehwat funnily, GetWALRecordsInfo() then ends up being unnecessarily dilligent about cleaning up O(1) memory, after not caring about O(N) memory... Greetings, Andres Freund
Commits
-
Limit memory usage of pg_walinspect functions.
- da32a99df1f5 15.3 landed
- 69e8c7cf1dfa 16.0 landed