postgresql/contrib/pg_walinspect
Jeff Davis 69e8c7cf1d Limit memory usage of pg_walinspect functions.
GetWALRecordsInfo() and pg_get_wal_fpi_info() can leak memory across
WAL record iterations. Fix this by using a temporary memory context
that's reset for each WAL record iteraion.

Also a use temporary context for loops in GetXLogSummaryStats(). The
number of iterations is a small constant, so the previous behavior was
not a leak, but fix for clarity (but no need to backport).

Backport GetWALRecordsInfo() change to version
15. pg_get_wal_fpi_info() didn't exist in version 15.

Reported-by: Peter Geoghegan
Author: Bharath Rupireddy
Discussion: https://www.postgresql.org/message-id/CAH2-WznLEJjn7ghmKOABOEZYuJvkTk%3DGKU3m0%2B-XBAH%2BerPiJQ%40mail.gmail.com
Backpatch-through: 15
2023-02-20 11:07:24 -08:00
..
expected pg_walinspect: Add pg_get_wal_fpi_info() 2023-01-23 13:55:18 +09:00
sql pg_walinspect: Add pg_get_wal_fpi_info() 2023-01-23 13:55:18 +09:00
.gitignore
Makefile pg_walinspect: Add pg_get_wal_fpi_info() 2023-01-23 13:55:18 +09:00
meson.build pg_walinspect: Add pg_get_wal_fpi_info() 2023-01-23 13:55:18 +09:00
pg_walinspect--1.0--1.1.sql pg_walinspect: Add pg_get_wal_fpi_info() 2023-01-23 13:55:18 +09:00
pg_walinspect--1.0.sql Use float8 datatype for percentiles in pg_walinspect stat functions 2022-09-12 10:01:00 +02:00
pg_walinspect.c Limit memory usage of pg_walinspect functions. 2023-02-20 11:07:24 -08:00
pg_walinspect.control pg_walinspect: Add pg_get_wal_fpi_info() 2023-01-23 13:55:18 +09:00
walinspect.conf Fix buildfarm failures in pg_walinspect tests. 2022-04-08 03:21:12 -07:00