pgsql: Don't leak rd_statlist when a relcache entry is dropped.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't leak rd_statlist when a relcache entry is dropped.
Date: 2021-03-19 02:23:41
Message-ID: E1lN4nd-0001oW-KK@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't leak rd_statlist when a relcache entry is dropped.

Although these lists are usually NIL, and even when not empty
are unlikely to be large, constant relcache update traffic could
eventually result in visible bloat of CacheMemoryContext.

Found via valgrind testing.
Back-patch to v10 where this field was added.

Discussion: https://postgr.es/m/3816764.1616104288@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/967b693eaef10aab76038163c6abd5778db38c51

Modified Files
--------------
src/backend/utils/cache/relcache.c | 1 +
1 file changed, 1 insertion(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2021-03-19 02:30:13 pgsql: Fix comments in postmaster.c.
Previous Message Tomas Vondra 2021-03-19 01:17:52 pgsql: Fix TAP test for remove_temp_files_after_crash