# 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 {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `postmaster` | Requires a server restart |
| Unit | `MB` | Raw unit |
| Range | `0` – `2147483647` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Resource Usage / Memory | Upstream classification |
| Latest boot value | `0` | 0 B |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG14 |
| Present in | PG14–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`84b1c63ad418`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=84b1c63ad41872792d47e523363fce1f0e230022) — Preallocate some DSM space at startup. |
| Commit date | 2020-07-31 |
| Discussion | [thread 1](https://postgr.es/m/CA%2BhUKGLAE2QBv-WgGp%2BD9P_J-%3Dyne3zof9nfMaqq1h3EGHFXYQ%40mail.gmail.com) |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG14–19 Beta 3 | `0` | `MB` | 0 B |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#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.

## Tuning advice {#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. |
{.full-width}

## Pigsty {#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 | — | — |
{.full-width}

> [!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 {#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 {#related-parameters}

[`dynamic_shared_memory_type`](/parameters/dynamic-shared-memory-type/) · [`huge_pages`](/parameters/huge-pages/) · [`max_parallel_workers`](/parameters/max-parallel-workers/) · [`max_parallel_workers_per_gather`](/parameters/max-parallel-workers-per-gather/) · [`shared_buffers`](/parameters/shared-buffers/)

## References {#references}

- [PostgreSQL 19 Beta 3 — min_dynamic_shared_memory](https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-MIN-DYNAMIC-SHARED-MEMORY)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
