Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak)

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Matthias Otterbach <mo(at)otterbach(dot)eu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak)
Date: 2019-03-18 18:50:43
Message-ID: CAMkU=1wW32K8n4ut_7zz+6HH1J068tFtpv5os=eeAgvjiQH8ZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Mar 18, 2019 at 2:26 PM Matthias Otterbach <mo(at)otterbach(dot)eu> wrote:

> >
> > I confess that I'm not actually trying this with JDBC, but with
> > libpq (via psql and pgbench). One could imagine that JDBC is
> > presenting the query sufficiently differently to cause different
> > backend behavior, say by asking for binary not text output ---
> > but I tried that, no change.
>
> Can I do anything to figure out how the JDBC driver presents the query?
>

You can set log_statement to 'all' to get a view of the statements issued.

Doing that, I can reproduce the problem, and it seems to be using an
implicitly declared cursor (which I have not run into before). That might
ring a bell for Tom.

1600 [unknown] BEGIN 00000 2019-03-18 14:36:00.120 EDT LOG: execute S_1:
BEGIN
1600 [unknown] SELECT 00000 2019-03-18 14:36:00.130 EDT LOG: execute
S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:00.785 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:01.359 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:01.948 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:02.451 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:03.000 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:03.483 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
1600 [unknown] SELECT 00000 2019-03-18 14:36:04.029 EDT LOG: execute fetch
from S_2/C_3: SELECT b FROM public.a
....

Cheers,

Jeff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2019-03-18 19:35:39 Re: BUG #15641: Autoprewarm worker fails to start on Windows with huge pages in use Old PostgreSQL community/pgsql-bugs x
Previous Message Matthias Otterbach 2019-03-18 18:39:32 Re: BUG #15700: PG 10 vs. 11: Large increase in memory usage when selecting BYTEA data (maybe memory leak)