Configuration parameter

shared_memory_type — PostgreSQL configuration parameter

Category Resource Consumption Change scope Postmaster

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.

At a glance

Property Value
Parameter 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 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 sysvipc). 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 shared_memory_type; or SELECT name, setting, unit, context, source FROM pg_settings WHERE name = '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.

Reference

PostgreSQL documentation — shared_memory_type.

Keep going

Related & next steps

Concepts on this page

Was this helpful?

← All configuration parameters