{"Entry":{"collection":"guc","key":"shared_memory_size","name":"shared_memory_size","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"14","status":"added","to":"15"}],"content_hash":"6c84c800ba22092748170dd2c9150785e823c71afec87b4febed971d233524ca","context":"","default_changed_in":[],"default_history":[{"from":"15","to":"19","value":"0 B"}],"editorial":{"advice":{"olap":"Not tunable. Use shared_memory_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record shared_memory_size as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET.","small":"Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need."},"mechanism":["Shows the size of the server's main shared memory area (rounded up to the nearest MB). It is read-only and cannot be changed with SET or configuration-file edits.","It reports the rounded size of PostgreSQL's main shared-memory segment after startup sizing.","Interpret it with shared_memory_size_in_huge_pages, huge_pages, huge_pages_status. Applications and operations tooling may read shared_memory_size for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences."],"pitfalls":["Trying to change read-only shared_memory_size with SET or a configuration file.","Assuming every cluster, database, or vendor build reports the same value.","Ignoring the value in file-format or feature-compatibility checks.","Treating reported metadata as a performance target instead of an environment fact."],"references":[{"title":"PostgreSQL 19 Beta 4: shared_memory_size","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["shared_memory_size_in_huge_pages","huge_pages","huge_pages_status","num_os_semaphores","max_connections","block_size"],"summary":"shared_memory_size shows the size of the server's main shared memory area (rounded up to the nearest MB). It is read-only metadata in PG15–18, not a runtime tuning control."},"enumvals":[],"first_version":"15","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.967736+08:00","intro_commit":{"authored_at":"2021-09-08T12:02:30+09:00","discussion":["https://postgr.es/m/F2772387-CE0F-46BF-B5F1-CC55516EB885@amazon.com"],"hash":"bd1788051b02cfddcd9ef0e2fd094972f372b8fd","subject":"Introduce GUC shared_memory_size","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=bd1788051b02cfddcd9ef0e2fd094972f372b8fd"},"key":"shared_memory_size","last_version":"20","max_val":"","min_val":"","name":"shared_memory_size","position":358,"present_in":["15","16","17","18","19","20"],"short_desc":"Reports the size of the main shared memory area, rounded up to the nearest megabyte.","short_desc_zh":"","source_rev":"english-manuals:d05e99de5eef4ae9ab7d64036800da3fdfe8e8721a95de2e86c2d845065889bd","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"shared_memory_size","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"shared_memory_size","SourceRevision":"english-manuals:d05e99de5eef4ae9ab7d64036800da3fdfe8e8721a95de2e86c2d845065889bd","Facts":{"boot_val":"0","category":"Preset Options","context":"internal","description":"Reports the size of the main shared memory area, rounded up to the nearest megabyte.","doc":{"anchor":"GUC-SHARED-MEMORY-SIZE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"shared_memory_size","short_desc":"Shows the size of the server's main shared memory area (rounded up to the nearest MB).","source":"pg-settings-source-snapshot","unit":"MB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-SHARED-MEMORY-SIZE","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"shared_memory_size","SourceDatabase":"center","Version":"18","Locale":"en","Title":"shared_memory_size","Summary":"Reports the size of the main shared memory area, rounded up to the nearest megabyte.","BodyHTML":"\u003cp\u003eReports the size of the main shared memory area, rounded up to the nearest megabyte.\u003c/p\u003e","SourceRevision":"english-manuals:d05e99de5eef4ae9ab7d64036800da3fdfe8e8721a95de2e86c2d845065889bd","ContentHash":"8d7dde8e7bb50354186b49f23103b9032e56696d6d1d34df40c2108a663a25d1","Payload":{"description":"Reports the size of the main shared memory area, rounded up to the nearest megabyte."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
