Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 39C639FB948; Thu, 26 Apr 2007 10:04:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 38550-08; Thu, 26 Apr 2007 10:04:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mailhost.ics.forth.gr (mailhost.ics.forth.gr [139.91.157.55]) by postgresql.org (Postfix) with ESMTP id 66D5F9FB6FA; Thu, 26 Apr 2007 10:04:26 -0300 (ADT) Received: from mailhost.ics.forth.gr (mailhost.ics.forth.gr [139.91.157.55] (may be forged)) by mailhost.ics.forth.gr (8.13.8/ICS-FORTH/V10-Server-2.0.0) with ESMTP id l3QD4KCC003191; Thu, 26 Apr 2007 16:04:20 +0300 Received: from sappho.ics.forth.gr (unknown [127.0.0.1]) by mailhost.ics.forth.gr (Symantec Mail Security) with ESMTP id 0D55016C061; Thu, 26 Apr 2007 16:04:20 +0300 (EEST) X-AuditID: 7f000001-aa39ebb00000050a-03-4630a353ef05 Received: from SHADOWFAX (unknown [139.91.183.33]) by mailhost.ics.forth.gr (Symantec Mail Security) with ESMTP id 9371A8E40FC; Thu, 26 Apr 2007 16:04:19 +0300 (EEST) From: "Sorin N. Ciolofan" To: "'Bill Moran'" Cc: , Subject: Re: [GENERAL] pg_buffercache view Date: Thu, 26 Apr 2007 16:05:14 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <20070426083211.06c1c990.wmoran@potentialtech.com> Thread-Index: AceH/xRHm8GfsEqBQr++sgi+7mWJPgABHASQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Message-Id: <20070426130419.9371A8E40FC@mailhost.ics.forth.gr> X-Brightmail-Tracker: AAAAAA== X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/247 X-Sequence-Number: 25311 I don't know the algorithm on which Postgre uses the shared buffers but I'd like to find the principles behind it. Let's assume the following scenario: I've set shared_buffers=3000 At the starting of Postgres there are 115 buffers used by database A After the execution of some processing caused by a java methodA1() invocation, 2850 buffers are used by A. What happens next if these 2850 buffers remains used even if the methodA1() finished its execution? Suppose that now a methodA2() invocation occurs and this method works with database A, too. Will be the 2850 buffers reused or will postgre throw an "out of shared memory" exception? What happens if a methodB() invocation occurs, assuming that this method tries to work with database B? How Postgre decides the allocation of shared_buffers? Thanks Sorin -----Original Message----- From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Bill Moran Sent: Thursday, April 26, 2007 3:32 PM To: Sorin N. Ciolofan Cc: pgsql-general@postgresql.org; pgsql-admin@postgresql.org Subject: Re: [ADMIN] [GENERAL] pg_buffercache view In response to "Sorin N. Ciolofan" : > > Hello! > > Do you know which could be the reasons that could conduce an application to > not release the shared buffers, even after the application was shut down? > I noticed that only if a pg_ctl restart command is issued some of the > buffers are set free. The reason would be "by design." If the server flushes its cache every time the application restarts, the cache isn't going to be very effective. If PostgreSQL is using more shared buffers than you're comfortable with, reduce the shared_buffers setting in the config. That will allow the OS to decide how to use the memory instead. -- Bill Moran http://www.potentialtech.com ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/