Large CacheMemoryContext |
Catalog and relation metadata, schema size, partition counts, index counts, and backend lifetime. |
Many CachedPlanSource or CachedPlanQuery contexts |
Prepared statements, statement naming, application driver behavior, plan lifecycle, and long-lived connections. |
| Large executor-related contexts |
Currently executing SQL, query plans, sorts, hashes, aggregation, and settings such as work_mem. |
| PostgreSQL context total is much lower than RSS |
Native allocations, PGGate, allocator footprint, and memory outside PostgreSQL MemoryContexts. |
| Memory increases with backend lifetime |
Long-lived backend state, catalog/cache accumulation, prepared statements, pooling behavior, and backend recycling strategy. |