Re: memory leak in bounded sorts

From: Chengpeng Yan <chengpeng_yan(at)outlook(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: memory leak in bounded sorts
Date: 2026-12-02 10:43:23
Message-ID: D70DF370-E2D3-4730-8DE1-3ED2C0AF72D7@outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> On Dec 2, 2026, at 18:04, John Naylor <johncnaylorls(at)gmail(dot)com> wrote:
>
> While reviewing bounded-sort improvements, I found a separate issue:
> make_bounded_heap() doesn't free the root tuple when replaced (and
> hasn't for 10 years), which shows up as increased memory reporting,
> especially with inputs in reverse order.

Nice catch! The fix looks good to me.

--
Best regards,
Chengpeng Yan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rui Zhao 2026-12-02 11:05:53 Skip TOAST fetches for dropped columns when forming a row value
Previous Message Amit Kapila 2026-12-02 10:23:26 Re: ALTER DEFAULT PRIVILEGES IN SCHEMA pg_conflict silently has no effect