Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 4CAA79FB7A6 for ; Tue, 12 Jun 2007 14:25:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 05232-09 for ; Tue, 12 Jun 2007 14:25:32 -0300 (ADT) X-Greylist: delayed 00:30:08.140709 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 80A719FA21A for ; Tue, 12 Jun 2007 14:25:33 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by svr4.postgresql.org (Postfix) with ESMTP id 0A48A5AF0B2 for ; Tue, 12 Jun 2007 16:55:21 +0000 (GMT) Received: by fafnir.androme.com (Postfix, from userid 1003) id 17273B919C9; Tue, 12 Jun 2007 18:55:14 +0200 (CEST) Message-ID: <466ECFF1.1010302@androme.es> Date: Tue, 12 Jun 2007 18:55:13 +0200 From: Arnau Rebassa i Villalonga Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) MIME-Version: 1.0 To: "pgsql-admin@postgresql.org >> \"pgsql-admin@postgresql.org\"" Subject: A question about memory usage Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/107 X-Sequence-Number: 25775 Hi all, I have a server with 4GB of RAM and I wanted to know how much memory is being used by a PostgreSQL. To do so I have executed the following: ps -A -o rss,vsz,command|grep postgres | awk '{rss += $1; vsz += $2 } END { print "Real: ",rss/1024"MB Virtual: ",vsz/1024"MB" }' And the result is: Real: 157.59MB Virtual: 6359.04MB So I understand that amount of virtual memory must be swapped to disk as it's bigger that my physical memory. To check this I have executed the free command and I get the following results: total used free shared buffers cached Mem: 4153180 3988536 164644 0 161400 3117900 -/+ buffers/cache: 709236 3443944 Swap: 6215672 64 6215608 So my question is, what I'm doing wrong? because the swap it's almost empty Thank you very much -- Arnau