pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Roman Konoval <rkonoval@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Memory leak during delete with sequential scan
Date: Thu, 11 Sep 2014 22:17:57 -0400
Message-ID: <30254.1410488277@sss.pgh.pa.us> (raw)
In-Reply-To: <CABcZEEA22KAD4CpfC0qFdMi0EPRH08WTJmkhGUkG8Jq2+EBNWQ@mail.gmail.com>
References: <CABcZEEA22KAD4CpfC0qFdMi0EPRH08WTJmkhGUkG8Jq2+EBNWQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Roman Konoval <rkonoval@gmail.com> writes:
> The simplified test which demonstrates this problem.

> $ psql -U postgres postgres
> psql (9.1.11, server 9.3.5)

> postgres=# create table t (i integer, t text);
> CREATE TABLE

> postgres=# insert into t select v,
> '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
> || text(v) from generate_series(1,4000000) v;
> INSERT 0 4000000

> postgres=# \q

> restart postgres

> $ psql -U postgres postgres

> execute 500 times the following command in the same connection
> postgres=# delete from t where t = '';

I see absolutely no leak from this example in any existing release branch.

> This problem can be reliably reproducible only after restart of postgres.

That sounds suspiciously like what you are counting is a process's
accesses to shared memory.  You did not say what shared_buffers setting
you're using, but if the "leak" tops out at something close to your
shared_buffers setting then that's almost certainly what it is.
In Linux systems you should generally be looking at RES minus SHR
not just RES to determine a process' private memory.

			regards, tom lane


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



view thread (5+ messages)  latest in thread

Message-ID: <30254.1410488277@sss.pgh.pa.us>
Permalink:  ../30254.1410488277@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/30254.1410488277@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, rkonoval@gmail.com
  Subject: Re: Memory leak during delete with sequential scan
  In-Reply-To: <30254.1410488277@sss.pgh.pa.us>
  References: <CABcZEEA22KAD4CpfC0qFdMi0EPRH08WTJmkhGUkG8Jq2+EBNWQ@mail.gmail.com> <30254.1410488277@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