pg_shmemviz
pg_shmemviz · Capture shared-memory snapshots for offline structural visualization
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101983 | pg_shmemviz | pg_shmemviz | 0.1 | STAT | GPL-2.0-or-later | C |
Usage
Sources:
pg_shmemviz captures PostgreSQL shared memory for an offline browser viewer. Its extension version is 0.1; the README identifies the diagnostic release as 0.1.0-beta.1 and validates PostgreSQL 20devel. Use only a disposable or isolated development instance.
Capture and View
Use the exact server development files and an unstripped server executable containing DWARF debug information. The Python CLI needs LLDB with Python support on macOS or GDB with Python support elsewhere, plus local superuser database access.
Objects and Boundaries
pg_shmemviz_snapshot(text) and pg_shmemviz_snapshot(text, text) write snapshots to a server-side path; public execution is revoked. The CLI combines capture with executable layout metadata. --numa-scope selects NUMA inspection scope; pg_buffercache and --buffercache-details add optional buffer information. The viewer binds to loopback by default.
No preload is needed. Capture copies live memory sequentially without locking: related fields can represent different instants and multi-byte values can be torn. Snapshots may contain sensitive data and occupy substantial disk space. NUMA inspection can fault pages and affect placement. The debugger reads the executable’s metadata rather than attaching to the server. The viewer does not modify captured server memory.