Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJV04-0004Ku-Us for pgsql-performance@arkaria.postgresql.org; Mon, 18 Aug 2014 22:02:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XJV02-00049n-V6 for pgsql-performance@arkaria.postgresql.org; Mon, 18 Aug 2014 22:01:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJV00-00049a-MK for pgsql-performance@postgresql.org; Mon, 18 Aug 2014 22:01:56 +0000 Received: from nm23-vm6.bullet.mail.ne1.yahoo.com ([98.138.91.116]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJUzu-0002Eu-To for pgsql-performance@postgresql.org; Mon, 18 Aug 2014 22:01:54 +0000 Received: from [98.138.101.129] by nm23.bullet.mail.ne1.yahoo.com with NNFMP; 18 Aug 2014 22:01:47 -0000 Received: from [98.138.89.252] by tm17.bullet.mail.ne1.yahoo.com with NNFMP; 18 Aug 2014 22:01:47 -0000 Received: from [127.0.0.1] by omp1044.mail.ne1.yahoo.com with NNFMP; 18 Aug 2014 22:01:47 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 518148.60669.bm@omp1044.mail.ne1.yahoo.com Received: (qmail 27415 invoked by uid 60001); 18 Aug 2014 22:01:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1408399307; bh=TA+lpWRAlvW5sKEwPY5cykfCPikcurgIDJKkZxVwwYk=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=bC2woSWoC9uBJi7S7j0E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0aW9uIGlzIGxlc3MgdGhhbiAzMGsuCgo.PiBTRUxFQ1QgQ09VTlQoKikgZnJvbSBwZ19sb2NrczsKPgo.IEVSUk9SOsKgIGludmFsaWQgbWVtb3J5IGFsbG9jIHJlcXVlc3Qgc2l6ZSAxNTYyNDM2ODE2CgpJdCBnYXRoZXJzIHRoZSBpbmZvcm1hdGkBMAEBAQE- X-Mailer: YahooMailWebService/0.8.201.700 References: Message-ID: <1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com> Date: Mon, 18 Aug 2014 15:01:47 -0700 From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: query against pg_locks leads to large memory alloc To: Dave Owens , Merlin Moncure Cc: Matheus de Oliveira , postgres performance list In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Dave Owens wrote: > max_connections =3D 450 ...we have found that we run out of shared > memory when max_pred_locks_per_transaction is less than 30k. >> SELECT COUNT(*) from pg_locks; > > ERROR:=A0 invalid memory alloc request size 1562436816 It gathers the information in memory to return for all those locks (I think both the normal heavyweight locks and the predicate locks do that).=A0 450 * 30000 is 13.5 million predicate locks you could have, so they don't need a very big structure per lock to start adding up.=A0 I guess we should refactor that to use a tuplestore, so it can spill to disk when it gets to be more than work_mem. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance