pgmeminfo

show memory usage

Overview

PackageVersionCategoryLicenseLanguage
pgmeminfo1.0.0STATMITC
IDExtensionBinLibLoadCreateTrustRelocSchema
6520pgmeminfoNoYesNoYesNoNo-
Relatedpgfincore system_stats pg_buffercache pgnodemx pg_proctab pg_cooldown pgcozy pg_prewarm

no pg14 on el8/9 pgdg repo

Version

TypeRepoVersionPG VerPackageDeps
EXTMIXED1.0.01817161514pgmeminfo-
RPMPIGSTY1.0.01817161514pgmeminfo_$v-
DEBPIGSTY1.0.01817161514postgresql-$v-pgmeminfo-
OS / PGPG18PG17PG16PG15PG14
el8.x86_64
el8.aarch64
el9.x86_64
el9.aarch64
el10.x86_64
el10.aarch64
d12.x86_64
d12.aarch64
d13.x86_64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
d13.aarch64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
u22.x86_64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
u22.aarch64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
u24.x86_64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
u24.aarch64
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0
PIGSTY 1.0.0

Build

You can build the RPM / DEB packages for pgmeminfo using pig build:

pig build pkg pgmeminfo         # build RPM / DEB packages

Install

You can install pgmeminfo directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:

pig repo add pgsql -u          # Add repo and update cache

Install the extension using pig or apt/yum/dnf:

pig install pgmeminfo;          # Install for current active PG version
pig ext install -y pgmeminfo -v 18  # PG 18
pig ext install -y pgmeminfo -v 17  # PG 17
pig ext install -y pgmeminfo -v 16  # PG 16
pig ext install -y pgmeminfo -v 15  # PG 15
pig ext install -y pgmeminfo -v 14  # PG 14
dnf install -y pgmeminfo_18       # PG 18
dnf install -y pgmeminfo_17       # PG 17
dnf install -y pgmeminfo_16       # PG 16
dnf install -y pgmeminfo_15       # PG 15
dnf install -y pgmeminfo_14       # PG 14
apt install -y postgresql-18-pgmeminfo   # PG 18
apt install -y postgresql-17-pgmeminfo   # PG 17
apt install -y postgresql-16-pgmeminfo   # PG 16
apt install -y postgresql-15-pgmeminfo   # PG 15
apt install -y postgresql-14-pgmeminfo   # PG 14

Create Extension:

CREATE EXTENSION pgmeminfo;

Usage

pgmeminfo: PostgreSQL memory context information

pgmeminfo provides functions to inspect PostgreSQL backend memory usage and memory context hierarchies.

Functions

Memory information overview:

-- Show overall memory info
SELECT * FROM pgmeminfo();

Memory context hierarchy:

-- Show cumulative memory context sizes
SELECT * FROM pgmeminfo_contexts();

-- Show memory contexts to a specific depth
SELECT * FROM pgmeminfo_contexts(deep => 1);

-- Show all contexts without accumulation
SELECT * FROM pgmeminfo_contexts(deep => -1, accum_mode => 'off');

Last Modified 2026-03-12: add pg extension catalog (95749bf)