Skip to content

min_dynamic_shared_memory

min_dynamic_shared_memory — Amount of dynamic shared memory reserved at startup. Observed in PG14–19 Beta 3; its last measured boot default is 0 B in PG19 Beta 3, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA.
Note

Fact — official short description: “Amount of dynamic shared memory reserved at startup.”

Identity

Type , Valueinteger
Upstream pg_settings type
Context , Valuepostmaster
Requires a server restart
Unit , ValueMB
Raw unit
Range , Value02147483647
Raw limits in the last observed version
Enum values , Value
— for non-enum types
Category , ValueResource Usage / Memory
Upstream classification
Latest boot value , Value0
0 B

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

Measured PG9.0–19 Beta 3 boot defaults
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

Tip

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
Caution

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.

dynamic_shared_memory_type · huge_pages · max_parallel_workers · max_parallel_workers_per_gather · shared_buffers

References