postgresql/src/backend
Tomas Vondra 5dd7fc1519 Add transparent block-level memory accounting
Adds accounting of memory allocated in a memory context. Compared to
various ad hoc solutions, the main advantage is that the accounting is
transparent and does not require direct control over allocations (this
matters for use cases where the allocations happen in user code, like
for example aggregate states allocated in a transition functions).

To reduce overhead, the accounting happens at the block level (not for
individual chunks) and only the context immediately owning the block is
updated. When inquiring about amount of memory allocated in a context,
we have to recursively walk all children contexts.

This "lazy" accounting works well for cases with relatively small number
of contexts in the relevant subtree and/or with infrequent inquiries.

Author: Jeff Davis
Reivewed-by: Tomas Vondra, Melanie Plageman, Soumyadeep Chakraborty
Discussion: https://www.postgresql.org/message-id/flat/027a129b8525601c6a680d27ce3a7172dab61aab.camel@j-davis.com
2019-10-01 03:13:39 +02:00
..
access Make crash recovery ignore recovery target settings. 2019-09-30 10:18:15 +09:00
bootstrap Fix inconsistencies and typos in the tree 2019-07-16 13:23:53 +09:00
catalog Implement jsonpath .datetime() method 2019-09-25 22:51:51 +03:00
commands Silence -Wmaybe-uninitialized compiler warnings in dbcommands.c. 2019-09-27 14:14:30 -07:00
executor Don't generate EEOP_*_FETCHSOME operations for slots know to be virtual. 2019-09-30 16:06:16 -07:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Don't generate EEOP_*_FETCHSOME operations for slots know to be virtual. 2019-09-30 16:06:16 -07:00
lib Fix inconsistencies in the code 2019-07-08 13:15:09 +09:00
libpq Fix compilation with older OpenSSL versions 2019-09-28 22:49:01 +02:00
main initdb: Remove obsolete locale handling 2019-08-14 06:51:13 +02:00
nodes Allow setting statistics target for extended statistics 2019-09-11 00:25:51 +02:00
optimizer Prevent bogus pullup of constant-valued functions returning composite. 2019-09-24 12:11:32 -04:00
parser Fix handling of GENERATED columns in CREATE TABLE LIKE INCLUDING DEFAULTS. 2019-09-25 17:30:42 -04:00
partitioning Avoid using INFO elevel for what are fundamentally debug messages. 2019-09-07 19:03:11 -04:00
po Translation updates 2019-06-17 15:30:20 +02:00
port Remove mingwcompat.c 2019-09-17 11:34:28 +02:00
postmaster Rearrange postmaster's startup sequence for better syslogger results. 2019-09-11 11:43:01 -04:00
regex Fix inconsistencies and typos in the tree, take 9 2019-08-05 12:14:58 +09:00
replication Rework WAL-reading supporting structs 2019-09-24 16:39:53 -03:00
rewrite Rationalize use of list_concat + list_copy combinations. 2019-08-12 11:20:18 -04:00
snowball Sync our Snowball stemmer dictionaries with current upstream 2019-07-04 13:26:48 +02:00
statistics Allow setting statistics target for extended statistics 2019-09-11 00:25:51 +02:00
storage Speedup truncations of relation forks. 2019-09-24 17:31:26 +09:00
tcop Allow setting statistics target for extended statistics 2019-09-11 00:25:51 +02:00
tsearch Fix inconsistencies and typos in the tree, take 11 2019-08-19 16:21:39 +09:00
utils Add transparent block-level memory accounting 2019-10-01 03:13:39 +02: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 Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00