From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Euler Taveira <euler@timbira.com.br>
Cc: James Tomson <james@pushd.com>
Cc: pgsql-bugs@lists.postgresql.org, Eric Jensen <ej@pushd.com>
Subject: Re: invalid memory alloc request size from pg_stat_activity?
Date: Tue, 7 May 2019 10:55:13 -0400
Message-ID: <20190507145513.GA7111@alvherre.pgsql> (raw)
In-Reply-To: <CAHE3wghviO-OZK5=ZQ8YwXaq50xcVyCUARDCyaTk1viKiY=Qhw@mail.gmail.com>
On 2019-May-07, Euler Taveira wrote:
> Em seg, 6 de mai de 2019 às 20:04, James Tomson <james@pushd.com> escreveu:
> >
> > ourdb=> SELECT pid, state, age(query_start, clock_timestamp()), usename, query FROM pg_stat_activity WHERE query != '<IDLE>' AND state != 'idle' ORDER BY age limit 100;
> > ERROR: invalid memory alloc request size 1652113408
> >
> That is because it is limited to 1GB - 1.
>
> > Maybe this has to do with us setting track_activity_query_size=102400? Is there a known safe maximum for that, or could there be some other problem?
> >
> Question is: why do you want to return such a big query text? That's
> impractical for admin/monitoring tools. We can usually identify a
> query with 1024 bytes (that is the default).
Hmm, but 102400 is only 100kB, nowhere near the 1GB-1 limit, so there's
something odd going on there.
I would start investigating by attaching a debugger and setting a
breakpoint on 'errfinish', then running the above query; past the
backtrace here, as it might be illuminating.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: alvherre@2ndquadrant.com, euler@timbira.com.br, james@pushd.com, ej@pushd.com
Subject: Re: invalid memory alloc request size from pg_stat_activity?
In-Reply-To: <20190507145513.GA7111@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox