Re: Enhancing Memory Context Statistics Reporting

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Rahila Syed <rahilasyed90@gmail.com>, Daniel Gustafsson <daniel@yesql.se>, torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-13T20:26:02Z
Lists: pgsql-hackers
Hi,

On 2026-01-13 14:31:00 -0500, Robert Haas wrote:
> Also, it's not really safe to acquire an LWLock if there's no
> transaction active. If we error afterward, what will release the
> LWLock?

All the error handling paths (hopefully) have an LWLockReleaseAll()... Which
is pretty crucial given that we do stuff outside of transactions in other
places.

That doesn't mean the other concerns about resource management are unfounded,
however.

Greetings,

Andres Freund



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