Re: Memory leak on subquery as scalar operand

From: Lauri Laanmets <pcspets(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Memory leak on subquery as scalar operand
Date: 2022-10-31 14:16:18
Message-ID: CAPH-tTxWe5WRdfDbKigdLhyZA3e33s4_giK_G0FSGyjrFyUCAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I have tested it on version 12 that comes with Ubuntu 20.04.5 LTS. Then
upgraded to "PostgreSQL 14.5 (Ubuntu 14.5-2.pgdg20.04+2) on
x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0,
64-bit" from "deb http://apt.postgresql.org/pub/repos/apt focal-pgdg main"
but the behaviour is the same - if my example query is repeatedly executed
on an open session, the postgres process will start using 1 MB more RAM
after around every 14 times of execution. Until OOM-killer kills it.

I haven't changed any default settings and it can be reproduced also by
pgAdmin Query Tool that executes the query under 'postgres' user. Although
it's a bit tiresome to make so many executions manually.

It is interesting that it doesn't happen on Windows. Might be that it's
caused by the OS or system in general but I have no idea what to try or
test next.

The machine is: Linux 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22
UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Regards
Lauri

Kontakt Tom Lane (<tgl(at)sss(dot)pgh(dot)pa(dot)us>) kirjutas kuupäeval E, 31. oktoober
2022 kell 15:49:

> Lauri Laanmets <pcspets(at)gmail(dot)com> writes:
> > There seems to be a memory leak in PostgreSQL for Linux (doesn't happen
> on
> > Windows). At least in versions 12 to 14 (and not in 9.5). It can be
> > reproduced with the following SQL script on an empty database.
>
> Thanks for the test case! Unfortunately, I can't see any ill effects
> with it in currently released versions (I tried 12, 14, 15, and HEAD).
> Which minor releases did you try? Do you have any non-default
> settings or build options?
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Gunnar "Nick" Bluth 2022-10-31 14:20:15 Strange sort node/explain result
Previous Message Tom Lane 2022-10-31 13:40:23 Re: Memory leak on subquery as scalar operand