Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 11FCE9FBD33 for ; Wed, 17 Oct 2007 18:10:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 20911-09 for ; Wed, 17 Oct 2007 18:10:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id 8E8AE9FBD07 for ; Wed, 17 Oct 2007 18:10:39 -0300 (ADT) Received: from perhan.alvh.no-ip.org (201-220-127-162.bk10-dsl.surnet.cl [201.220.127.162]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l9HKf319020971; Wed, 17 Oct 2007 13:41:04 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 01A3D47C7A; Wed, 17 Oct 2007 17:40:58 -0300 (CLST) Date: Wed, 17 Oct 2007 17:40:58 -0300 From: Alvaro Herrera To: henk de wit Cc: Scott Marlowe , "pgsql-performance@postgresql.org" Subject: Re: Huge amount of memory consumed during transaction Message-ID: <20071017204058.GR5737@alvh.no-ip.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-Virus-Scanned: ClamAV 0.91.1/4542/Tue Oct 16 13:31:56 2007 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Wed, 17 Oct 2007 13:41:06 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/211 X-Sequence-Number: 27233 henk de wit escribió: > > How is the memory consumed? How are you measuring it? I assume you > > mean the postgres process that is running the query uses the memory. > > If so, which tool(s) are you using and what's the output that shows it > > being used? > > It's periodically measured and recorded by a script from which the relevant parts are: > > GET_VSZ="ps aux | grep $REQ_GREP | grep -v grep | grep -v $$ | awk '{print \$5}' > | sort -n | tail -n1"; > GET_RSS="ps aux | grep $REQ_GREP | grep -v grep | grep -v $$ | awk '{print \$6}' > | sort -n | tail -n1"; Huh, this seems really ugly, have you tried something like just $ ps -o cmd:50,vsz,rss -C postmaster CMD VSZ RSS /pgsql/install/00head/bin/postmaster 51788 3992 postgres: writer process 51788 1060 postgres: wal writer process 51788 940 postgres: autovacuum launcher process 51924 1236 postgres: stats collector process 22256 896 -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.