Glossary — in plain language

pg_backend_memory_contexts

Also called: backend memory contexts view, memory context introspection

In plain English

pg_backend_memory_contexts is a system view (PostgreSQL 14+) listing every memory context in the current backend — name, parent, depth level, and total/used/free bytes. It exposes the live context tree so you can see exactly where a backend’s memory is going.

Why it matters

It turns “this connection is using 2 GB” into “its CacheMemoryContext is 1.8 GB.” Paired with pg_log_backend_memory_contexts(pid), which dumps another backend’s contexts to the server log, it is the primary tool for diagnosing per-backend memory bloat.

Was this helpful?

← Browse the full glossary