DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Preset Options

shared_memory_size_in_huge_pages

Shows the number of huge pages needed for the main shared memory area. -1 means huge pages are not supported.

  • Default: -1
  • Type: integer
  • Range: -1 … 2147483647
  • Applies: Read-only

In plain words

How many huge pages the main shared memory would need: shared_memory_size divided by the huge page size, rounded up. Use it to reserve exactly enough huge pages in the operating system.

For DBAs and operators

Added in PostgreSQL 15; -1 when huge pages are not supported on the platform or the size cannot be determined. The intended workflow (server stopped):

postgres -D $PGDATA -C shared_memory_size_in_huge_pages   # e.g. 75
sysctl -w vm.nr_hugepages=80      # a little head-room, persist in sysctl.conf
# start PostgreSQL, then
SHOW huge_pages_status;           -- PG17+: on?

Recompute whenever you change shared_buffers, max_connections or huge_page_size.

How to change it

Fixed when PostgreSQL was built or the cluster was initialised. You can only read it.

See it in context

Memory architecture

Related parameters

shared_memory_size huge_pages huge_pages_status huge_page_size

All Preset Options parameters