pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@ymail.com>
To: Dave Owens <dave@teamunify.com>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Matheus de Oliveira <matioli.matheus@gmail.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: query against pg_locks leads to large memory alloc
Date: Mon, 18 Aug 2014 15:01:47 -0700
Message-ID: <1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com> (raw)
In-Reply-To: <CA+OQrzhBziFavzH==iqrJegR5Us6q7EvbopkQAWJV9f-UYVthQ@mail.gmail.com>
References: <CA+OQrzhdtpC-9enDpY_PTue3_eh9xxmP-z51fJHFqezvhJ-9Nw@mail.gmail.com>
	<CAJghg4+y5NcvjfJO+Ynad-5NcuHHOUOgFpUEP=fLA3WTgGAoCw@mail.gmail.com>
	<CAHyXU0w+haLQ2UdU_XjyiEPnC_Xp24QM4QjNYXFXQhtkvdSsgA@mail.gmail.com>
	<CA+OQrzhBziFavzH==iqrJegR5Us6q7EvbopkQAWJV9f-UYVthQ@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Dave Owens <dave@teamunify.com> wrote:



> max_connections = 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:  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).  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.  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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (20+ messages)  latest in thread

Message-ID: <1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com>
Permalink:  ../1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com/
Also on:    postgresql.org/message-id/1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com

 · 

reply

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-performance@postgresql.org
  Cc: kgrittn@ymail.com, dave@teamunify.com, mmoncure@gmail.com, matioli.matheus@gmail.com
  Subject: Re: query against pg_locks leads to large memory alloc
  In-Reply-To: <1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com>

* 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