{"Entry":{"collection":"guc","key":"shared_memory_size_in_huge_pages","name":"shared_memory_size_in_huge_pages","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"14","status":"added","to":"15"},{"documentation_changed":true,"fields":{},"from":"16","status":"changed","to":"17"},{"documentation_changed":false,"fields":{"extra_desc":{"from":"-1 indicates that the value could not be determined.","to":"-1 means huge pages are not supported."}},"from":"17","status":"changed","to":"18"}],"content_hash":"8aece6052cf73db53f2ea9ec0066da2a7c026e9babc018bdb7627ff0f281083e","context":"","default_changed_in":[],"default_history":[{"from":"15","to":"19","value":"-1"}],"editorial":{"advice":{"olap":"Not tunable. Use shared_memory_size_in_huge_pages to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record shared_memory_size_in_huge_pages 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 number of huge pages needed for the main shared memory area. It is read-only and cannot be changed with SET or configuration-file edits.","It estimates how many huge pages the main shared-memory segment needs and returns -1 when the platform cannot provide the estimate.","Interpret it with shared_memory_size, huge_pages, huge_pages_status. Applications and operations tooling may read shared_memory_size_in_huge_pages 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_in_huge_pages 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_in_huge_pages","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["shared_memory_size","huge_pages","huge_pages_status","num_os_semaphores","max_connections","block_size"],"summary":"shared_memory_size_in_huge_pages shows the number of huge pages needed for the main shared memory area. 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.970071+08:00","intro_commit":{"authored_at":"2021-09-21T10:31:58+09:00","discussion":["https://postgr.es/m/F2772387-CE0F-46BF-B5F1-CC55516EB885@amazon.com"],"hash":"43c1c4f65eab77bcfc4f535a7e9ac0421e0cf2a5","subject":"Introduce GUC shared_memory_size_in_huge_pages","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=43c1c4f65eab77bcfc4f535a7e9ac0421e0cf2a5"},"key":"shared_memory_size_in_huge_pages","last_version":"20","max_val":"","min_val":"","name":"shared_memory_size_in_huge_pages","position":359,"present_in":["15","16","17","18","19","20"],"short_desc":"Reports the number of huge pages that are needed for the main shared memory area based on the specified huge_page_size.","short_desc_zh":"","source_rev":"english-manuals:c89fb65b53fd727a71466795860d32386d1a37db602fab5cc8d6619af8aae972","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"shared_memory_size_in_huge_pages","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"shared_memory_size_in_huge_pages","SourceRevision":"english-manuals:c89fb65b53fd727a71466795860d32386d1a37db602fab5cc8d6619af8aae972","Facts":{"boot_val":"-1","category":"Preset Options","context":"internal","description":"Reports the number of huge pages that are needed for the main shared memory area based on the specified huge_page_size. If huge pages are not supported, this will be -1. This setting is supported only on Linux. It is always set to -1 on other platforms. For more details about using huge pages on Linux, see Section 18.4.5.","doc":{"anchor":"GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"-1 means huge pages are not supported.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"-1","name":"shared_memory_size_in_huge_pages","short_desc":"Shows the number of huge pages needed for the main shared memory area.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-SHARED-MEMORY-SIZE-IN-HUGE-PAGES","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"shared_memory_size_in_huge_pages","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"shared_memory_size_in_huge_pages","Summary":"","BodyHTML":"\u003cp\u003e报告基于指定的\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-HUGE-PAGE-SIZE\" rel=\"nofollow\"\u003ehuge_page_size\u003c/a\u003e所需的主共享内存区域的大页数。如果不支持大页，这将是\u003ccode\u003e-1\u003c/code\u003e。\u003c/p\u003e\u003cp\u003e这个设置仅在\u003cspan\u003eLinux\u003c/span\u003e上受支持。在其他平台上，它始终设置为\u003ccode\u003e-1\u003c/code\u003e。有关在\u003cspan\u003eLinux\u003c/span\u003e上使用大页的更多详细信息，请参见\u003ca href=\"/docs/18/kernel-resources.html#LINUX-HUGE-PAGES\" rel=\"nofollow\"\u003e第 18.4.5 节\u003c/a\u003e。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"93306eed1b2666602455db1295a5366f6ff4ecc784111cca893321a363875339","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e报告基于指定的\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-HUGE-PAGE-SIZE\"\u003ehuge_page_size\u003c/a\u003e所需的主共享内存区域的大页数。如果不支持大页，这将是\u003ccode class=\"literal\"\u003e-1\u003c/code\u003e。\u003c/p\u003e\u003cp\u003e这个设置仅在\u003cspan class=\"productname\"\u003eLinux\u003c/span\u003e上受支持。在其他平台上，它始终设置为\u003ccode class=\"literal\"\u003e-1\u003c/code\u003e。有关在\u003cspan class=\"productname\"\u003eLinux\u003c/span\u003e上使用大页的更多详细信息，请参见\u003ca href=\"/docs/18/kernel-resources.html#LINUX-HUGE-PAGES\" title=\"18.4.5. Linux 大页\"\u003e第 18.4.5 节\u003c/a\u003e。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
