Re: Enhancing Memory Context Statistics Reporting

Rahila Syed <rahilasyed90@gmail.com>

From: Rahila Syed <rahilasyed90@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Robert Haas <robertmhaas@gmail.com>
Date: 2026-02-10T00:03:37Z
Lists: pgsql-hackers

Attachments

Hi,

Please find attached rebased and updated patches that include a few fixes
suggested by Daniel.

Fixes include
1. Changed LW_SHARED to LW_EXCLUSIVE when resetting client_keys.
2. Replaced calls to MemoryContextReset with MemoryContextDelete since a
new memory context is created each time.
3. Removed leftover code from earlier versions in ipci.c
4. Fix the TAP test to compare strings correctly.
5. Added more comments in the TAP test.

Thank you,
Rahila Syed

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