Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XSGR4-0002Ma-DM for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 02:18:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XSGR3-0001MC-Bo for pgsql-bugs@arkaria.postgresql.org; Fri, 12 Sep 2014 02:18:05 +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 1XSGR2-0001M5-Dd for pgsql-bugs@postgresql.org; Fri, 12 Sep 2014 02:18:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XSGQy-000211-UF for pgsql-bugs@postgresql.org; Fri, 12 Sep 2014 02:18:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id s8C2HvIn030255; Thu, 11 Sep 2014 22:17:57 -0400 From: Tom Lane To: Roman Konoval cc: pgsql-bugs@postgresql.org Subject: Re: Memory leak during delete with sequential scan In-reply-to: References: Comments: In-reply-to Roman Konoval message dated "Fri, 12 Sep 2014 01:07:15 +0300" Date: Thu, 11 Sep 2014 22:17:57 -0400 Message-ID: <30254.1410488277@sss.pgh.pa.us> X-Pg-Spam-Score: -4.4 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Roman Konoval 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