mem_collector
mem_collector · Query memory feature collection and window-level workload snapshots
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102276 | mem_collector | mem_collector | 1.0 | STAT | MIT | C |
PostgreSQL · 12
Usage
Sources:
mem_collector 1.0 collects query memory features and window summaries for a research memory-tuning pipeline. Upstream targets PostgreSQL 12. Planner/executor hooks and shared-memory buffers require preloading and a server restart.
Configure and Read Samples
Configure the database in which the worker persists samples:
After restarting, install as a superuser in that database:
The versioned SQL implements the first two read functions as recent persisted-table views; their names do not establish a direct view of unflushed ring contents. mem_collector_generate_window_sample creates an explicit window sample, and mem_collector_reset resets collection state. Protect access to collected query/workload metadata and schedule retention for the persistent sample tables.
Interpretation and Operations
Features cover sort/hash operators and simplified parallel ratios. Peak memory and spill signals are estimates derived from public executor structures. Several pressure and pool-usage fields remain unimplemented, and ratios use host physical memory rather than a PostgreSQL memory-pool budget. This is not a production memory accounting authority or an automatic memory limiter.
Shared-memory rings are lost on restart; persisted sample tables survive. A worker aimed at another database needs the SQL objects there. Check that samples actually advance after enabling collection and after upgrades, and monitor table growth and collection overhead.