{"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"}],"derived_content_hash":"766bc6e4a81f3982a5022cc16f761c7406a623f9032f6c874c98d56dd1910770","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"],"repair_provenance":{"original_source_revision":"english-manuals:c89fb65b53fd727a71466795860d32386d1a37db602fab5cc8d6619af8aae972","receipt_sha256":"f3d9cbad1893b7a8b6cdfb4627460cf005395d30bd826a1b21a204fbd5dd4e7b","repair":"wiki-repair-20261023"},"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":"wiki-repair-20261023:98ec8bd1ee3e6fd36946c68a47c9b495571777bc94409898da8f627fcd4b9306","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":"wiki-repair-20261023:98ec8bd1ee3e6fd36946c68a47c9b495571777bc94409898da8f627fcd4b9306","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.","description_zh":"报告基于指定的 huge_page_size 所需的主共享内存区域的大页数。如果不支持大页，这将是 -1。 这个设置仅在 Linux 上受支持。在其他平台上，它始终设置为 -1。有关在 Linux 上使用大页的更多详细信息，请参见第 18.4.5 节。","description_zh_html":"\u003cp\u003e\n        报告基于指定的 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-resource.html#GUC-HUGE-PAGE-SIZE\"\u003ehuge_page_size\u003c/a\u003e 所需的主共享内存区域的大页数。如果不支持大页，这将是 \u003ccode class=\"literal\"\u003e-1\u003c/code\u003e。\n       \u003c/p\u003e\u003cp\u003e\n        这个设置仅在 \u003cspan class=\"productname\"\u003eLinux\u003c/span\u003e 上受支持。在其他平台上，它始终设置为 \u003ccode class=\"literal\"\u003e-1\u003c/code\u003e。有关在 \u003cspan class=\"productname\"\u003eLinux\u003c/span\u003e 上使用大页的更多详细信息，请参见\u003ca class=\"xref\" href=\"/zh/docs/18/kernel-resources.html#LINUX-HUGE-PAGES\" title=\"18.4.5. Linux 大页\"\u003e第 18.4.5 节\u003c/a\u003e。\n       \u003c/p\u003e","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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-preset.html","sha256":"d0e95b9a81d5fdf853df26eba7dc096d96b9b45dadda13e0d0353aa72ac7a7b9"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-pgdoc"},"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":"center","Version":"18","Locale":"en","Title":"shared_memory_size_in_huge_pages","Summary":"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.","BodyHTML":"\u003cp\u003eReports 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.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:98ec8bd1ee3e6fd36946c68a47c9b495571777bc94409898da8f627fcd4b9306","ContentHash":"444e054f01b3dc3a36af5e807dac80753f6ae1c1bc8f7533482cc34d8d02093e","Payload":{"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."}},"RequestedLocale":"en","Fallback":false,"Versions":["15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
