Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 784966322DD for ; Sun, 28 Feb 2010 12:42:52 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29690-05 for ; Sun, 28 Feb 2010 16:42:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id E7F66632202 for ; Sun, 28 Feb 2010 12:42:41 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o1SGgdnD009488; Sun, 28 Feb 2010 11:42:40 -0500 (EST) To: Chris cc: pgsql-performance@postgresql.org Subject: Re: How to troubleshoot high mem usage by postgres? In-reply-to: <57033cf81002271525w3bddc0acn63a5fd3f649068d4@mail.gmail.com> References: <57033cf81002271429wb0da13am37b3cb6258103ea5@mail.gmail.com> <57033cf81002271525w3bddc0acn63a5fd3f649068d4@mail.gmail.com> Comments: In-reply-to Chris message dated "Sat, 27 Feb 2010 16:25:26 -0700" Date: Sun, 28 Feb 2010 11:42:39 -0500 Message-ID: <9487.1267375359@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/398 X-Sequence-Number: 37819 Chris writes: > @Tom Lane: > As I mentioned above I am not doing everything in a single > transaction. However I do want to try your suggestion regarding > getting a "memory context map". But I'm afraid I don't know how to do > what you are describing. How can I set the ulimit of postmaster? Depends on the script you are using to start the postmaster. One way is to call ulimit in the startup script right before it invokes the postmaster. However, if you have something like su - postgres -c "postmaster ..." then I'd try putting it in the postgres user's ~/.profile or ~/.bash_profile instead; the su is likely to reset such things. > And > does the postmaster stderr output go to the postgres log file? Also depends. Look at the startup script and see where it redirects postmaster's stderr to. You might have to modify the script --- some are known to send stderr to /dev/null :-( Sorry to be so vague, but different packagers have different ideas about how to do this. regards, tom lane