Re: query against pg_locks leads to large memory alloc - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: query against pg_locks leads to large memory alloc
Date
Msg-id 1408399307.93048.YahooMailNeo@web122304.mail.ne1.yahoo.com
Whole thread Raw
In response to Re: query against pg_locks leads to large memory alloc  (Dave Owens <dave@teamunify.com>)
Responses Re: query against pg_locks leads to large memory alloc  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-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


pgsql-performance by date:

Previous
From: Dave Owens
Date:
Subject: Re: query against pg_locks leads to large memory alloc
Next
From: Tom Lane
Date:
Subject: Re: query against pg_locks leads to large memory alloc