Specifies the dynamic shared memory implementation that the server should use.
At a glance
| Property | Value |
|---|---|
| Parameter | dynamic_shared_memory_type |
| Category | Resource Consumption |
| Default | (see documentation) |
| Value type | enum |
| Change scope | Server restart required (postgresql.conf) |
| Available in | PostgreSQL 12, 13, 14, 15, 16, 17, 18, 19 (added in 12) |
What it does
Specifies the dynamic shared memory implementation that the server should use. Possible values are posix (for POSIX shared memory allocated using shm_open), sysv (for System V shared memory allocated via shmget), windows (for Windows shared memory), and mmap (to simulate shared memory using memory-mapped files stored in the data directory). Not all values are supported on all platforms; the first supported option is usually the default for that platform. The use of the mmap option, which is not the default on any platform, is generally discouraged because the operating system may write modified pages back to disk repeatedly, increasing system I/O load; however, it may be useful for debugging, when the pg_dynshmem directory is stored on a RAM disk, or when other shared memory facilities are not available. This parameter can only be set at server start.
(Description quoted from the official PostgreSQL documentation.)
How to apply a change
Set it in postgresql.conf (or with ALTER SYSTEM) and restart the server — this parameter cannot change without a restart.
Inspect the current value and source with SHOW dynamic_shared_memory_type; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = 'dynamic_shared_memory_type';.
Tuning guidance
This parameter is rarely a performance lever. Leave it at the default unless you have a specific, documented reason to change it, change it on one session or one role/database first, and confirm the effect with pg_settings and your own measurements before rolling it out cluster-wide.