Re: pg_upgrade: fix memory leak in SLRU I/O code - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: pg_upgrade: fix memory leak in SLRU I/O code
Date
Msg-id 202602051024.2j4dpyfy22zr@alvherre.pgsql
Whole thread Raw
In response to Re: pg_upgrade: fix memory leak in SLRU I/O code  (Chao Li <li.evan.chao@gmail.com>)
List pgsql-hackers
On 2026-Feb-05, Chao Li wrote:

> Exactly. In this case, memory leaking is not a problem at all. My
> thinking was that once we do decide to free the top-level object, it
> feels more consistent and less surprising to also free what it owns,
> even if the lifetime is effectively the whole process. It’s less about
> resource pressure and more about keeping the ownership model clear for
> future readers and maintenance.

Maybe we should just change the "pg_free(state)" to "/* no point freeing
memory */" or something like that.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"We're here to devour each other alive"            (Hobbes)



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Truncate logs by max_log_size
Next
From: Michael Paquier
Date:
Subject: Re: Small fixes for incorrect error messages