X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 52C2A9F9B01 for ; Wed, 2 Aug 2006 13:35:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 67198-10 for ; Wed, 2 Aug 2006 13:35:01 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 8E40F9FA491 for ; Wed, 2 Aug 2006 13:35:01 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 2 Aug 2006 16:34:59 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 02 Aug 2006 11:34:59 -0500 Subject: Re: What's using all my RAM? From: Scott Marlowe To: adey Cc: "pgsql-admin@postgresql.org" , PostgreSQL Admin , postgresql-l In-Reply-To: <1c66bda80608012109x125180eeh38674c853ea50434@mail.gmail.com> References: <1c66bda80608012109x125180eeh38674c853ea50434@mail.gmail.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1154536499.7882.51.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 02 Aug 2006 11:34:59 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.066 tagged_above=0 required=5 tests=AWL, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200608/24 X-Sequence-Number: 22568 On Tue, 2006-08-01 at 23:09, adey wrote: > Please could someone tell me how to discover what is using all of my > RAM? > I am trying to run a vacuum against Postgres, but it fails immediately > with:- > > "ERROR: out of memory > DETAIL: Failed on request of size 1073741820." > > TOP shows the following:- > Mem: 4077544k total, 3897868k used, 179676k free, 146960k > buffers > Swap: 2000084k total, 440k used, 1999644k free, 3352892k > cached > None of the listed processes appear to be using more than 1 or 2% MEM. nothing is using your ram in the traditional sense.You're kernel is caching files in the space that's not currently being used by applications. note that you show 3897868k used, and 3352892k cached. So, the actual memory being use by applications is the in use minus the cached, or about 544,000k. The rest is actually available, and the kernel will gladly give it back if a program needs it. You actual problem here is that your machine is trying to allocate approx 1 Gig at once. Large allocations tend to point towards some kind of data corruption in your database, but not always. Try a vacuuming each table one at a time to see which one is causing this error (if it's not already in the error message and got edited away.) See if a select of all rows on that table gets the same error message. > Postgres v7.4.2 (upgrade underway) If you can get a clean backup, look into at least 8.0. There were huge improvements from 7.4 to 8.0. 8.1 is even more impressive. (says the DBA who's still running 7.4.13 on all his boxes... :)