Re: BUG #17844: Memory consumption for memoize node

From: Alexey Ermakov <alexey(dot)ermakov(at)dataegret(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17844: Memory consumption for memoize node
Date: 2023-03-20 06:23:11
Message-ID: bccbeb7e-e945-6aa8-7610-7df1057d774a@dataegret.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2023-03-19 15:33, David Rowley wrote:
> On Sat, 18 Mar 2023 at 13:22, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>> It seems to be related to a bug in nodeMemoize.c where we're
>> evaluating the cache key expressions in the ExecutorState context. We
>> should really be in a more temporary context that gets reset early in
>> cache_lookup() before the call to prepare_probe_slot(). I'll need to
>> look in a bit more detail about what that context actually should be.
> I've attached fix_memoize_memory_leak.patch to address this.
>
> Using your test case, here are the memory stats before and after the
> fix (taken during ExecEndMemoize).
>
Thanks a lot! Could you please point me in the direction how to get such
memory stats ? I might know another memory leak I'd like to check but
sadly I don't know right tools to measure memory usage.

--

Thanks,

Alexey Ermakov

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2023-03-20 07:00:00 Re: BUG #17847: Unaligned memory access in ltree_gist
Previous Message David Rowley 2023-03-20 03:37:29 Re: BUG #17844: Memory consumption for memoize node