Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id DA4556B258F for ; Thu, 29 Dec 2011 16:10:37 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RgMJ6-0002VE-P4 for pgsql-bugs@postgresql.org; Thu, 29 Dec 2011 20:10:37 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pBTKAHpQ027189; Thu, 29 Dec 2011 15:10:17 -0500 (EST) To: havasvolgyi.otto@gmail.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6365: Memory leak in insert and update In-reply-to: References: Comments: In-reply-to havasvolgyi.otto@gmail.com message dated "Thu, 29 Dec 2011 19:52:20 +0000" Date: Thu, 29 Dec 2011 15:10:17 -0500 Message-ID: <27188.1325189417@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -3.2 (---) X-Archive-Number: 201112/244 X-Sequence-Number: 32055 havasvolgyi.otto@gmail.com writes: > The following bug has been logged on the website: > Bug reference: 6365 > Logged by: Otto Havasvölgyi > Email address: havasvolgyi.otto@gmail.com > PostgreSQL version: 9.1.2 > Operating system: Win XP SP2 x86; Linux Debian 2.6.32 kernel x64 > Description: > The bug can be reproduced with pgbench: I see no memory leak with this example. I suspect you are being fooled by tools that report shared memory as being used by a process only after it first touches a given page of shared memory ("top" on Linux does that, for example). This will cause the apparent memory consumption of any long-lived backend to increase until it has touched every available shared buffer. But that's not a leak, just an artifact of the reporting tool. You can confirm for yourself that that's what's happening by reducing shared_buffers to a few megabytes and observing that reported memory usage increases up to that much and then stops growing. On Linux, I find that watching the "VIRT" column of top output is a far more reliable guide to whether a memory leak is actually occuring. Can't offer any suggestions as to what to use on Windows. regards, tom lane