aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-09-08 12:02:30 +0900
committerMichael Paquier <michael@paquier.xyz>2021-09-08 12:02:30 +0900
commitbd1788051b02cfddcd9ef0e2fd094972f372b8fd (patch)
treea0bc449c2d8a6b6e91fe96d7b2353c3d91339085 /src/backend/utils/misc/guc.c
parentfd0625c7a9c679c0c1e896014b8f49a489c3a245 (diff)
downloadpostgresql-bd1788051b02cfddcd9ef0e2fd094972f372b8fd.tar.gz
postgresql-bd1788051b02cfddcd9ef0e2fd094972f372b8fd.zip
Introduce GUC shared_memory_size
This runtime-computed GUC shows the size of the server's main shared memory area, taking into account the amount of shared memory allocated by extensions as this is calculated after processing shared_preload_libraries. Author: Nathan Bossart Discussion: https://postgr.es/m/F2772387-CE0F-46BF-B5F1-CC55516EB885@amazon.com
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 467b0fd6fe7..c339acf0670 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -664,6 +664,7 @@ static int max_index_keys;
static int max_identifier_length;
static int block_size;
static int segment_size;
+static int shared_memory_size_mb;
static int wal_block_size;
static bool data_checksums;
static bool integer_datetimes;
@@ -2338,6 +2339,17 @@ static struct config_int ConfigureNamesInt[] =
},
{
+ {"shared_memory_size", PGC_INTERNAL, RESOURCES_MEM,
+ gettext_noop("Shows the size of the server's main shared memory area (rounded up to the nearest MB)."),
+ NULL,
+ GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_UNIT_MB
+ },
+ &shared_memory_size_mb,
+ 0, 0, INT_MAX,
+ NULL, NULL, NULL
+ },
+
+ {
{"temp_buffers", PGC_USERSET, RESOURCES_MEM,
gettext_noop("Sets the maximum number of temporary buffers used by each session."),
NULL,