pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Shianmiin <Shianmiin@gmail.com>
Cc: pgsql-general@postgresql.org
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: [GENERAL] PostgreSQL backend process high memory usage issue
Date: Wed, 13 Apr 2011 01:29:43 -0400
Message-ID: <26138.1302672583@sss.pgh.pa.us> (raw)
In-Reply-To: <BANLkTikTY=o2s4HzE0L5+wiqUDVEu-EaKQ@mail.gmail.com>
References: <1302208932097-4289407.post@n5.nabble.com>
	<BANLkTiniE+Aoey3deGW_hVAMVBELxgJqQg@mail.gmail.com>
	<1302215437402-4289630.post@n5.nabble.com>
	<1302266587288-4290723.post@n5.nabble.com>
	<1302276600400-4291173.post@n5.nabble.com>
	<BANLkTi=oKpzWDcew+J-c+p1anUv=gLjHOw@mail.gmail.com>
	<1302289242961-4291699.post@n5.nabble.com>
	<BANLkTimwd389+f63Tztn5YcDRcsfsLYaww@mail.gmail.com>
	<1302300463012-4292010.post@n5.nabble.com>
	<BANLkTinPOBAV+Cjuc0q5GduiLmqQzA=Hpw@mail.gmail.com>
	<1302630534510-4298807.post@n5.nabble.com>
	<BANLkTikTY=o2s4HzE0L5+wiqUDVEu-EaKQ@mail.gmail.com>

Merlin Moncure <mmoncure@gmail.com> writes:
> I think you may have uncovered a leak (I stand corrected).

> The number of schemas in your test is irrelevant -- the leak is
> happening in proportion to the number of views (set via \setrandom
> tidx 1 10).  At 1 I don't think it exists at all -- at 100 memory use
> grows very fast.

I don't think it's a leak, exactly: it's just that the "relcache" entry
for each one of these views occupies about 100K.  A backend that touches
N of the views is going to need about N*100K in relcache space.  I can't
get terribly excited about that.  Trying to reduce the size of the
relcache would be a net loss for most usage patterns (ie, we'd end up
increasing the amount of re-fetching from the system catalogs that
backends would have to do).  And I don't think that this test case has
much of anything to do with sane application design, anyway.  Do you
really need that many complex views?  Do you really need to have most
sessions touching all of them?

			regards, tom lane



view thread (24+ messages)  latest in thread

Message-ID: <26138.1302672583@sss.pgh.pa.us>
Permalink:  ../26138.1302672583@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26138.1302672583@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mmoncure@gmail.com, Shianmiin@gmail.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] PostgreSQL backend process high memory usage issue
  In-Reply-To: <26138.1302672583@sss.pgh.pa.us>
  References: <1302208932097-4289407.post@n5.nabble.com> <BANLkTiniE+Aoey3deGW_hVAMVBELxgJqQg@mail.gmail.com> <1302215437402-4289630.post@n5.nabble.com> <1302266587288-4290723.post@n5.nabble.com> <1302276600400-4291173.post@n5.nabble.com> <BANLkTi=oKpzWDcew+J-c+p1anUv=gLjHOw@mail.gmail.com> <1302289242961-4291699.post@n5.nabble.com> <BANLkTimwd389+f63Tztn5YcDRcsfsLYaww@mail.gmail.com> <1302300463012-4292010.post@n5.nabble.com> <BANLkTinPOBAV+Cjuc0q5GduiLmqQzA=Hpw@mail.gmail.com> <1302630534510-4298807.post@n5.nabble.com> <BANLkTikTY=o2s4HzE0L5+wiqUDVEu-EaKQ@mail.gmail.com> <26138.1302672583@sss.pgh.pa.us>

* 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