postgresql/src/backend
Tom Lane d3f48dfae4 Further reduce memory footprint of CLOBBER_CACHE_ALWAYS testing.
Some buildfarm members using CLOBBER_CACHE_ALWAYS have been having OOM
problems of late.  Commit 2455ab488 addressed this problem by recovering
space transiently used within RelationBuildPartitionDesc, but it turns
out that leaves quite a lot on the table, because other subroutines of
RelationBuildDesc also leak memory like mad.  Let's move the temp-context
management into RelationBuildDesc so that leakage from the other
subroutines is also recovered.

I examined this issue by arranging for postgres.c to dump the size of
MessageContext just before resetting it in each command cycle, and
then running the update.sql regression test (which is one of the two
that are seeing buildfarm OOMs) with and without CLOBBER_CACHE_ALWAYS.
Before 2455ab488, the peak space usage with CCA was as much as 250MB.
That patch got it down to ~80MB, but with this patch it's about 0.5MB,
and indeed the space usage now seems nearly indistinguishable from a
non-CCA build.

RelationBuildDesc's traditional behavior of not worrying about leaking
transient data is of many years' standing, so I'm pretty hesitant to
change that without more evidence that it'd be useful in a normal build.
(So far as I can see, non-CCA memory consumption is about the same with
or without this change, whuch if anything suggests that it isn't useful.)
Hence, configure the patch so that we recover space only when
CLOBBER_CACHE_ALWAYS or CLOBBER_CACHE_RECURSIVELY is defined.  However,
that choice can be overridden at compile time, in case somebody would
like to do some performance testing and try to develop evidence for
changing that decision.

It's possible that we ought to back-patch this change, but in the
absence of back-branch OOM problems in the buildfarm, I'm not in
a hurry to do that.

Discussion: https://postgr.es/m/CA+TgmoY3bRmGB6-DUnoVy5fJoreiBJ43rwMrQRCdPXuKt4Ykaw@mail.gmail.com
2019-03-15 13:46:26 -04:00
..
access Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
bootstrap tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
catalog Sync commentary in transam.h and bki.sgml. 2019-03-14 00:23:40 -04:00
commands Improve code comment 2019-03-14 22:44:21 +01:00
executor Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Renaming for new subscripting mechanism 2019-02-01 12:50:32 -03:00
lib Move hash_any prototype from access/hash.h to utils/hashutils.h 2019-03-11 13:17:50 -03:00
libpq Add new clientcert hba option verify-full 2019-03-09 12:19:47 -08:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Refactor ParamListInfo initialization 2019-03-14 13:30:09 +01:00
optimizer Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
parser Fix the BY {REF,VALUE} clause of XMLEXISTS/XMLTABLE 2019-03-07 11:20:35 -03:00
partitioning Further reduce memory footprint of CLOBBER_CACHE_ALWAYS testing. 2019-03-15 13:46:26 -04:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Add shared_memory_type GUC. 2019-02-03 12:47:26 +01:00
postmaster Use condition variables to wait for checkpoints. 2019-03-14 10:59:33 +13:00
regex Update copyright for 2019 2019-01-02 12:44:25 -05:00
replication Add walreceiver API to get remote server version 2019-03-15 10:16:26 +01:00
rewrite tableam: Add and use scan APIs. 2019-03-11 12:46:41 -07:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Rename nodes/relation.h to nodes/pathnodes.h. 2019-01-29 16:49:25 -05:00
storage Enable parallel query with SERIALIZABLE isolation. 2019-03-15 17:47:04 +13:00
tcop Refactor ParamListInfo initialization 2019-03-14 13:30:09 +01:00
tsearch Move hash_any prototype from access/hash.h to utils/hashutils.h 2019-03-11 13:17:50 -03:00
utils Further reduce memory footprint of CLOBBER_CACHE_ALWAYS testing. 2019-03-15 13:46:26 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00