1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-31 17:02:12 +03:00

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
This commit is contained in:
Michael Paquier
2021-09-08 12:02:30 +09:00
parent fd0625c7a9
commit bd1788051b
5 changed files with 56 additions and 0 deletions

View File

@@ -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;
@@ -2337,6 +2338,17 @@ static struct config_int ConfigureNamesInt[] =
NULL, NULL, NULL
},
{
{"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."),