pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_buffercache: Fix memory allocation formula
Date: Thu, 11 Dec 2025 05:12:21 +0000
Message-ID: <E1vTYyS-00060t-0e@gemulon.postgresql.org> (raw)

pg_buffercache: Fix memory allocation formula

The code over-allocated the memory required for os_page_status, relying
on uint64 for its element size instead of an int, hence doubling what
was required.  This could mean quite a lot of memory if dealing with a
lot of NUMA pages.

Oversight in ba2a3c2302f1.

Author: David Geier <geidav.pg@gmail.com>
Discussion: https://postgr.es/m/ad0748d4-3080-436e-b0bc-ac8f86a3466a@gmail.com
Backpatch-through: 18

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/580b5c2f397fbb2f74c2661cfe53203ed6acead0

Modified Files
--------------
contrib/pg_buffercache/pg_buffercache_pages.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)



view thread (2+ messages)

Message-ID: <E1vTYyS-00060t-0e@gemulon.postgresql.org>
Permalink:  ../E1vTYyS-00060t-0e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vTYyS-00060t-0e@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pg_buffercache: Fix memory allocation formula
  In-Reply-To: <E1vTYyS-00060t-0e@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox