postgresql/src
Tom Lane cd3064f989 Fix per-relation memory leakage in autovacuum.
PgStat_StatTabEntry and AutoVacOpts structs were leaked until
the end of the autovacuum worker's run, which is bad news if
there are a lot of relations in the database.

Note: pfree'ing the PgStat_StatTabEntry structs here seems a bit
risky, because pgstat_fetch_stat_tabentry_ext does not guarantee
anything about whether its result is long-lived.  It appears okay
so long as autovacuum forces PGSTAT_FETCH_CONSISTENCY_NONE, but
I think that API could use a re-think.

Also ensure that the VacuumRelation structure passed to
vacuum() is in recoverable storage.

Back-patch to v15 where we started to manage table statistics
this way.  (The AutoVacOpts leakage is probably older, but
I'm not excited enough to worry about just that part.)

Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/285483.1746756246@sss.pgh.pa.us
Backpatch-through: 15
2025-05-23 14:43:43 -04:00
..
backend Fix per-relation memory leakage in autovacuum. 2025-05-23 14:43:43 -04:00
bin Translation updates 2025-05-05 12:14:36 +02:00
common With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:07 -07:00
fe_utils In fmtIdEnc(), handle failure of enlargePQExpBuffer(). 2025-02-16 12:46:35 -05:00
include Make our usage of memset_s() conform strictly to the C11 standard. 2025-05-18 12:45:55 -04:00
interfaces With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:07 -07:00
makefiles Optimize pg_popcount() with AVX-512 instructions. 2024-04-06 21:56:23 -05:00
pl Translation updates 2025-05-05 12:14:36 +02:00
port Make our usage of memset_s() conform strictly to the C11 standard. 2025-05-18 12:45:55 -04:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Fix cross-version upgrade test failure 2025-05-20 10:41:20 +03:00
timezone Update time zone data files to tzdata release 2025b. 2025-04-30 11:14:01 -04:00
tools meson: Flush stdout in testwrap 2025-03-19 09:04:09 -04:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Update Unicode data to CLDR 45 2024-04-22 09:16:33 +02:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00