Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO1aQ-000775-4n for pgsql-bugs@arkaria.postgresql.org; Tue, 07 May 2019 15:00:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hO1aO-00045b-N5 for pgsql-bugs@arkaria.postgresql.org; Tue, 07 May 2019 15:00:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO1Z7-00081E-Ok for pgsql-bugs@lists.postgresql.org; Tue, 07 May 2019 14:59:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hO1Z5-0005Ql-8p for pgsql-bugs@lists.postgresql.org; Tue, 07 May 2019 14:59:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x47ExUCb028357; Tue, 7 May 2019 10:59:30 -0400 From: Tom Lane To: James Tomson cc: pgsql-bugs@lists.postgresql.org, Eric Jensen Subject: Re: invalid memory alloc request size from pg_stat_activity? In-reply-to: <1CFDCCD6-B268-48D8-85C8-400D2790B2C3@pushd.com> References: <1CFDCCD6-B268-48D8-85C8-400D2790B2C3@pushd.com> Comments: In-reply-to James Tomson message dated "Mon, 06 May 2019 19:04:18 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28355.1557241170.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 07 May 2019 10:59:30 -0400 Message-ID: <28356.1557241170@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk James Tomson writes: > We're upgrading from postgresql 9.6 to 10.6 and everything is working fi= ne, but any query against pg_stat_activity results in ERROR: invalid memo= ry alloc request size 1652113408 > e.g: > ourdb=3D> SELECT pid, state, age(query_start, clock_timestamp()), usenam= e, query FROM pg_stat_activity WHERE query !=3D '' AND state !=3D 'i= dle' ORDER BY age limit 100; > ERROR: invalid memory alloc request size 1652113408 That seems odd ... > Maybe this has to do with us setting track_activity_query_size=3D102400? It wouldn't surprise me if reading pg_stat_activity causes allocation of track_activity_query_size * max_connections bytes, but unless you also have max_connections set to some pretty insane value, that wouldn't be enough to fit this observation. Did you have these parameters set differently in 9.6? regards, tom lane