select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

CONFIGURATION / PRESET OPTIONS

shared_memory_size

Read PG 18 manual ↗

Reports the size of the main shared memory area, rounded up to the nearest megabyte.

Type
integer
Context
internal
Measured default
0 B
Unit
MB
Metadata snapshot
18

Definition PG 18 manual

Reports the size of the main shared memory area, rounded up to the nearest megabyte.

Measured default history
Version intervalDefault
15 – 190 B
Analysis & operational context

Authored guidance from the GUC source snapshot; the version-specific manual above is the definition reference. View source ↗

How it works

Shows the size of the server's main shared memory area (rounded up to the nearest MB). It is read-only and cannot be changed with SET or configuration-file edits.

It reports the rounded size of PostgreSQL's main shared-memory segment after startup sizing.

Interpret it with shared_memory_size_in_huge_pages, huge_pages, huge_pages_status. Applications and operations tooling may read shared_memory_size for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences.

Operational considerations

Trying to change read-only shared_memory_size with SET or a configuration file.

Assuming every cluster, database, or vendor build reports the same value.

Ignoring the value in file-format or feature-compatibility checks.

Treating reported metadata as a performance target instead of an environment fact.

Workload guidance

OLAP: Not tunable. Use shared_memory_size to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.

OLTP: Not tunable. Record shared_memory_size as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET.

SMALL: Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need.

Version history 1
  1. PG 14 → 15added

Related entries

Further reading

Definition snapshot: english-manuals:e392e7743a0cd3ac742143a6250… · English manual source