min_dynamic_shared_memory
Fact — official short description: “Amount of dynamic shared memory reserved at startup.”
Identity
Lifecycle
| Fact | Value |
|---|---|
| First observed | PG14 |
| Present in | PG14–19 Beta 3 |
| Removed in | No |
| Introduction commit | 84b1c63ad418 — Preallocate some DSM space at startup. |
| Commit date | 2020-07-31 |
| Discussion | thread 1 |
Default history
| Versions | Raw boot_val |
Unit | Human value |
|---|---|---|---|
| PG14–19 Beta 3 | 0 |
MB |
0 B |
How it works
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.
Tuning advice
Advice. These are workload-specific starting points and must be validated with measurements.
| Workload | Guidance |
|---|---|
| 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. |
| 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. |
| Small nodes | Keep 0 or a small measured reservation. Do not convert speculative future parallel demand into permanently allocated memory on a constrained host. |
Pigsty
Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.
| Template | Effective value | Versus upstream boot | Source expression |
|---|---|---|---|
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
Advice — pending human review. Fact from the current Pigsty template projection: OLTP: PG14–19 Beta 3 unmodified; OLAP: PG14–19 Beta 3 unmodified; CRIT: PG14–19 Beta 3 unmodified; TINY: PG14–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.
Common 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.
Related parameters
dynamic_shared_memory_type · huge_pages · max_parallel_workers · max_parallel_workers_per_gather · shared_buffers
References
- PostgreSQL 19 Beta 3 — min_dynamic_shared_memory
- PostgreSQL 19 release notes
- Machine-readable GUC export