min_dynamic_shared_memory
Read PG 18 manual ↗Specifies the amount of memory that should be allocated at server startup for use by parallel queries.
- Type
- integer
- Context
- postmaster
- Measured default
- 0 B
- Unit
- MB
- Metadata snapshot
- 18
Definition PG 18 manual
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.
Measured default history
| Version interval | Default |
|---|---|
| 14 – 19 | 0 B |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
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.
Operational considerations
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.
Workload guidance
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.
Version history 1
- PG 13 → 14added
Related entries
Further reading
Definition snapshot: english-manuals:a55eea04c5dd5709a37c5db9f4d… · English manual source