postgresql/src
Tom Lane 1c1294be71 Prevent long-term memory leakage in autovacuum launcher.
get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com
2022-08-31 16:23:35 -04:00
..
backend Prevent long-term memory leakage in autovacuum launcher. 2022-08-31 16:23:35 -04:00
bin Refactor check_ functions to use filehandle for status 2022-08-31 13:06:50 +02:00
common Clean up inconsistent use of fflush(). 2022-08-29 13:55:41 -04:00
fe_utils Clean up inconsistent use of fflush(). 2022-08-29 13:55:41 -04:00
include Derive freeze cutoff from nextXID, not OldestXmin. 2022-08-31 11:37:35 -07:00
interfaces Fix MSVC warning in compat_informix/rnull.pgc 2022-08-31 09:31:22 -07:00
makefiles solaris: Remove unnecessary gcc / gnu ld vs sun studio differences 2022-08-07 09:36:01 -07:00
pl plpython: Don't create pgxsdir subdirectory in installdir target 2022-08-31 07:42:01 +02:00
port Cleanup more code and comments related to Windows NT4 (XP days) 2022-08-30 09:52:58 +09:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:28:37 -04:00
test Fix a bug in roles_is_member_of. 2022-08-31 08:22:24 -04:00
timezone Remove fallbacks for strtoll, strtoull. 2022-08-06 09:59:51 +12:00
tools Improve performance of and reduce overheads of memory management 2022-08-29 17:15:00 +12:00
tutorial Update copyright for 2022 2022-01-07 19:04:57 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Remove unused configure variable. 2022-08-18 11:22:13 -04:00
Makefile.shlib aix: Fix SHLIB_EXPORTS reference in VPATH builds 2022-08-24 20:39:46 -07:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00