{"Entry":{"collection":"guc","key":"min_dynamic_shared_memory","name":"min_dynamic_shared_memory","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Memory","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"13","status":"added","to":"14"}],"content_hash":"7ada8a7740d2f611fab469136ea180d5299489f342b01a5bfb7eb38dc897426f","context":"","default_changed_in":[],"default_history":[{"from":"14","to":"19","value":"0 B"}],"derived_content_hash":"4481e6b9a44e3793a824af4c16be9c3c05f3fcf7723ac03026653ca4a83b8497","editorial":{"advice":{"olap":"Preallocation can reduce temporary DSM setup overhead for frequent concurrent parallel queries. Measure DSM allocation latency and pool use, then reserve only a justified floor; exhaustion still falls back to dynamic allocation.","oltp":"Leave 0 unless repeated parallel-query startup shows measurable dynamic-shared-memory allocation overhead. Any nonzero value is real resident startup memory, so include it in the cluster memory budget even when no parallel query runs.","small":"Keep 0 or a small measured reservation. Do not convert speculative future parallel demand into permanently allocated memory on a constrained host."},"mechanism":["min_dynamic_shared_memory preallocates real memory at server start for parallel-query dynamic shared memory. It is a reserved pool, not a maximum and not an estimate of cache size.","When the pool is insufficient, parallel queries can still allocate temporary dynamic shared memory through dynamic_shared_memory_type, with additional operating-system allocation overhead.","Startup allocation joins the main shared-memory region and can benefit from huge pages where supported. Reserving too much consumes memory even when parallel work is absent. Its postmaster context fixes the value at server start; changing it requires a restart."],"pitfalls":["Treating min_dynamic_shared_memory as a maximum instead of a real preallocated floor.","Assuming parallel queries fail when the reserved pool is exhausted; PostgreSQL can allocate additional dynamic segments.","Reserving memory that remains committed even when parallel work is absent.","Ignoring dynamic_shared_memory_type, huge-page behavior, and the required restart."],"references":[{"title":"PostgreSQL 19 Beta 4: min_dynamic_shared_memory","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-MIN-DYNAMIC-SHARED-MEMORY"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["dynamic_shared_memory_type","huge_pages","max_parallel_workers","max_parallel_workers_per_gather","shared_buffers"],"summary":"min_dynamic_shared_memory — Amount of dynamic shared memory reserved at startup. Observed in PG14–19 Beta 4; its last measured boot default is 0 B in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"14","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:31.771852+08:00","intro_commit":{"authored_at":"2020-07-31T17:27:09+12:00","discussion":["https://postgr.es/m/CA%2BhUKGLAE2QBv-WgGp%2BD9P_J-%3Dyne3zof9nfMaqq1h3EGHFXYQ%40mail.gmail.com"],"hash":"84b1c63ad41872792d47e523363fce1f0e230022","subject":"Preallocate some DSM space at startup.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=84b1c63ad41872792d47e523363fce1f0e230022"},"key":"min_dynamic_shared_memory","last_version":"20","max_val":"","min_val":"","name":"min_dynamic_shared_memory","position":292,"present_in":["14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"english-manuals:2bd491c0d491762166ac798b4a08713f542cf7b7dbb819fa3c331fcff4802778","receipt_sha256":"7d8f6aa083104e5e3f0599627e5c6afee706fdf8e512234ccda427f7b8556e23","repair":"wiki-repair-20261023"},"short_desc":"Specifies the amount of memory that should be allocated at server startup for use by parallel queries.","short_desc_zh":"","source_rev":"wiki-repair-20261023:cab8b3c4b517179565d7b1eef95bc4ecc520b552acfadab3c89f2255f6749536","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"min_dynamic_shared_memory","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"min_dynamic_shared_memory","SourceRevision":"wiki-repair-20261023:cab8b3c4b517179565d7b1eef95bc4ecc520b552acfadab3c89f2255f6749536","Facts":{"boot_val":"0","category":"Resource Usage / Memory","context":"postmaster","description":"Specifies the amount of memory that should be allocated at server startup for use by parallel queries. When this memory region is insufficient or exhausted by concurrent queries, new parallel queries try to allocate extra shared memory temporarily from the operating system using the method configured with dynamic_shared_memory_type, which may be slower due to memory management overheads. Memory that is allocated at startup with min_dynamic_shared_memory is affected by the huge_pages setting on operating systems where that is supported, and may be more likely to benefit from larger pages on operating systems where that is managed automatically. The default value is 0 (none). This parameter can only be set at server start.","description_zh":"指定服务器启动时为并行查询分配的内存量。当此内存区域不足或被并发查询耗尽时，新的并行查询会尝试使用 dynamic_shared_memory_type 配置的方法，临时向操作系统分配额外的共享内存；由于内存管理开销，这可能较慢。在支持 huge_pages 设置的操作系统上，启动时通过 min_dynamic_shared_memory 分配的内存会受到该设置的影响；在自动管理巨型页的操作系统上，这些内存也可能更容易受益于较大的页。默认值为 0（不分配）。此参数只能在服务器启动时设置。","description_zh_html":"\u003cp\u003e\n        指定服务器启动时为并行查询分配的内存量。当此内存区域不足或被并发查询耗尽时，新的并行查询会尝试使用 \u003ccode class=\"varname\"\u003edynamic_shared_memory_type\u003c/code\u003e 配置的方法，临时向操作系统分配额外的共享内存；由于内存管理开销，这可能较慢。在支持 \u003ccode class=\"varname\"\u003ehuge_pages\u003c/code\u003e 设置的操作系统上，启动时通过 \u003ccode class=\"varname\"\u003emin_dynamic_shared_memory\u003c/code\u003e 分配的内存会受到该设置的影响；在自动管理巨型页的操作系统上，这些内存也可能更容易受益于较大的页。默认值为 \u003ccode class=\"literal\"\u003e0\u003c/code\u003e（不分配）。此参数只能在服务器启动时设置。\n       \u003c/p\u003e","doc":{"anchor":"GUC-MIN-DYNAMIC-SHARED-MEMORY","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"min_dynamic_shared_memory","short_desc":"Amount of dynamic shared memory reserved at startup.","source":"pg-settings-source-snapshot","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-resource.html","sha256":"f5fedbf88ec5f973aaf4e525c03e46dda2a2186dabee154e26780da96b2ac85a"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":"MB","vartype":"integer","zh_from":"same-version-pgdoc"},"ManualEvidence":{"doc":{"anchor":"GUC-MIN-DYNAMIC-SHARED-MEMORY","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"min_dynamic_shared_memory","SourceDatabase":"center","Version":"18","Locale":"en","Title":"min_dynamic_shared_memory","Summary":"Specifies the amount of memory that should be allocated at server startup for use by parallel queries. When this memory region is insufficient or exhausted by concurrent queries, new parallel queries try to allocate extra shared memory temporarily from the operating system using the method configured with dynamic_shared_memory_type, which may be slower due to memory management overheads. Memory that is allocated at startup with min_dynamic_shared_memory is affected by the huge_pages setting on operating systems where that is supported, and may be more likely to benefit from larger pages on operating systems where that is managed automatically. The default value is 0 (none). This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eSpecifies the amount of memory that should be allocated at server startup for use by parallel queries. When this memory region is insufficient or exhausted by concurrent queries, new parallel queries try to allocate extra shared memory temporarily from the operating system using the method configured with dynamic_shared_memory_type, which may be slower due to memory management overheads. Memory that is allocated at startup with min_dynamic_shared_memory is affected by the huge_pages setting on operating systems where that is supported, and may be more likely to benefit from larger pages on operating systems where that is managed automatically. The default value is 0 (none). This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:cab8b3c4b517179565d7b1eef95bc4ecc520b552acfadab3c89f2255f6749536","ContentHash":"f7f31ee0cc61c7f087d826ed9a99b3ac636666ef37766187c9a09e134c13227b","Payload":{"description":"Specifies the amount of memory that should be allocated at server startup for use by parallel queries. When this memory region is insufficient or exhausted by concurrent queries, new parallel queries try to allocate extra shared memory temporarily from the operating system using the method configured with dynamic_shared_memory_type, which may be slower due to memory management overheads. Memory that is allocated at startup with min_dynamic_shared_memory is affected by the huge_pages setting on operating systems where that is supported, and may be more likely to benefit from larger pages on operating systems where that is managed automatically. The default value is 0 (none). This parameter can only be set at server start."}},"RequestedLocale":"en","Fallback":false,"Versions":["14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
