Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 113F11337B66 for ; Thu, 25 Nov 2010 21:46:14 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 60826-09 for ; Fri, 26 Nov 2010 01:46:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id E34021337999 for ; Thu, 25 Nov 2010 21:46:06 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id 5A37A149E; Thu, 25 Nov 2010 20:46:06 -0500 (EST) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1zC-9GRsAWcK; Thu, 25 Nov 2010 20:46:05 -0500 (EST) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id 6E5CF27; Thu, 25 Nov 2010 20:46:05 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 6A3E2AEC63; Fri, 26 Nov 2010 09:46:04 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id LeB5taXFHz0w; Fri, 26 Nov 2010 09:45:58 +0800 (WST) Received: from [10.1.1.5] (58-7-167-58.dyn.iinet.net.au [58.7.167.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 3F23AAE240; Fri, 26 Nov 2010 09:45:58 +0800 (WST) Message-ID: <4CEF1153.7040208@postnewspapers.com.au> Date: Fri, 26 Nov 2010 09:45:55 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc14 Thunderbird/3.1.4 MIME-Version: 1.0 To: Darryl Pye CC: pgsql-bugs@postgresql.org Subject: Re: BUG #5767: Memory Leak References: <201011250428.oAP4Sp4f087291@wwwmaster.postgresql.org> In-Reply-To: <201011250428.oAP4Sp4f087291@wwwmaster.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/167 X-Sequence-Number: 28747 On 11/25/2010 12:28 PM, Darryl Pye wrote: > PostgreSQL version: 9.01 32-bit or 64-bit ? > A single postgres process appears to be constantly growing in memory usage > until it reaches 100% of memory on the machine. How are you watching it? Task manager? You need to use something that can differentiate between the shared memory block and the per-task private memory. Process Explorer can do that, IIRC. > I have rebooted the server and the problem goes away but then a single > postgres.exe process continues to eat memory until it uses all available > ram then i have to restart again. Are you able to identify which postgres process it is? Is it shown in "SELECT * from pg_stat_activity;" ? Is it one of the postgres processes that appears when PostgreSQL is first started, before any connections are made to the database server? Are you sure you're not looking at totals for all postgres.exe instances? > I have made the following configuration changes from default > shared_buffers = 1GB > wal_buffers = 1MB > effective_cache_size = 2GB With those settings, you should expect PostgreSQL to appear to use a bit over 1GB of RAM per postgres.exe, though the vast majority of that 1GB should be shared between all the postgres.exe processes so the total memory of all postgres.exe instances will appear to vastly exceed your machine's RAM. That's just because of the bad accounting for shared memory in most OSes, including windows, and doesn't affect how it runs. -- Craig Ringer