Re: Stack-based tracking of per-node WAL/buffer usage

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: Lukas Fittl <lukas(at)fittl(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Andres Freund <andres(at)anarazel(dot)de>, Tomas Vondra <tomas(at)vondra(dot)me>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Peter Smith <smithpb2250(at)gmail(dot)com>
Subject: Re: Stack-based tracking of per-node WAL/buffer usage
Date: 2026-03-24 22:59:45
Message-ID: CAN4CZFPJOG0PeLOBmZZvkY+aeZJ0+swjNjUabaeeimWxbtN41A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I like the new approach, but doesn't `EXPLAIN (BUFFERS)` leak some
memory because the resource owner isn't registered on that path? It
seems to be visible with pg_log_backend_memory_contexts.

#define INSTR_BUFUSAGE_ADD(fld,val) do { \
- pgBufferUsage.fld += val; \
+ instr_stack.current->bufusage.fld += val; \

#define INSTR_WALUSAGE_ADD(fld,val) do { \
pgWalUsage.fld += val; \
+ instr_stack.current->walusage.fld += val; \

Nitpick, but these could use += (val)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2026-03-24 23:07:51 Re: Use CASEFOLD() internally rather than LOWER()
Previous Message Jeff Davis 2026-03-24 22:47:47 Re: [19] CREATE SUBSCRIPTION ... SERVER