shared_memory_type
Read PG 18 manual ↗Specifies the shared memory implementation that the server should use for the main shared memory region that holds PostgreSQL's shared buffers and other shared data.
- Type
- enum
- Context
- postmaster
- Measured default
- mmap
- Unit
- —
- Metadata snapshot
- 18
- Allowed values
- sysv, mmap
Definition PG 18 manual
Specifies the shared memory implementation that the server should use for the main shared memory region that holds PostgreSQL's shared buffers and other shared data. Possible values are mmap (for anonymous shared memory allocated using mmap), sysv (for System V shared memory allocated via shmget) and windows (for Windows shared memory). Not all values are supported on all platforms; the first supported option is the default for that platform. The use of the sysv option, which is not the default on any platform, is generally discouraged because it typically requires non-default kernel settings to allow for large allocations (see Section 18.4.1). This parameter can only be set at server start.
Measured default history
| Version interval | Default |
|---|---|
| 12 – 19 | mmap |
Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗
How it works
shared_memory_type selects the operating-system mechanism for PostgreSQL's main shared-memory region, including shared_buffers and other fixed shared state. It does not set the region's size.
Supported enum values and the first-supported boot default are platform dependent. The Docker/Linux catalog reports mmap; Windows has its own implementation, and sysv can require nondefault kernel limits for large allocations.
On Linux, explicit huge_pages support requires mmap. This parameter is distinct from dynamic_shared_memory_type, which governs temporary dynamic segments used by parallel query and extensions. Its postmaster context fixes the value at server start; changing it requires a restart.
Operational considerations
Treating the Linux-Docker mmap boot value as a portable default for every operating system.
Selecting sysv without raising the System V shared-memory kernel limits needed for the main region.
Forgetting that explicit huge pages on Linux require shared_memory_type=mmap.
Expecting the parameter to resize shared_buffers or other shared allocations.
Workload guidance
OLAP: Large shared_buffers increases the importance of reliable main-region allocation, but workload label does not select the API. Validate startup, huge pages, failover, and service limits on the target operating system rather than benchmarking storage throughput.
OLTP: Keep the first supported platform default; on Linux that is normally mmap and is required for PostgreSQL's explicit huge-page support. Use sysv only for a verified compatibility need and provision its kernel limits before restart.
SMALL: Keep the platform default. Changing the implementation does not reduce the configured shared-memory size and can add kernel-limit or portability failures.
Version history 4
- PG 16 → 17changed
- PG 13 → 14changed
- PG 12 → 13changed
- PG 11 → 12added
Related entries
Further reading
Definition snapshot: english-manuals:62e82027e7565c88167d17b3d43… · English manual source