Re: Enhancing Memory Context Statistics Reporting

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Rahila Syed <rahilasyed90@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-04-07T13:41:37Z
Lists: pgsql-hackers

Attachments

Following up on some off-list comments, attached is a v26 with a few small last
changes:

  * Improved documentation (docs and comments)
  * Fixed up Shmem sizing and init
  * Delayed registering to the shmem cleanup to get it earlier in cleanup
  * Renamed a few datastructures to improve readability
  * Various bits of polish

I think this function can be a valuable debugging aid going forward.

--
Daniel Gustafsson

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Cross-check lists of built-in LWLock tranches.

  2. Convert strncpy to strlcpy

  3. Typo and doc fixups for memory context reporting

  4. Add missing string terminator

  5. Rename argument in pg_get_process_memory_contexts().

  6. Add function to get memory context stats for processes