Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 415E9632CDD for ; Wed, 16 Sep 2009 13:31:20 -0300 (ADT) 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 51001-10 for ; Wed, 16 Sep 2009 16:31:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from hogranch.com (hogranch.com [75.101.82.47]) by mail.postgresql.org (Postfix) with ESMTP id DCA01632EE4 for ; Wed, 16 Sep 2009 13:31:11 -0300 (ADT) Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id n8GGV4f16295; Wed, 16 Sep 2009 09:31:04 -0700 Message-ID: <4AB112C3.1050809@hogranch.com> Date: Wed, 16 Sep 2009 09:30:59 -0700 From: John R Pierce User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Angelo Nicolosi CC: pgsql-jdbc@postgresql.org Subject: Re: OOM on large SELECT References: <4AB100D7.60805@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean 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: 200909/22 X-Sequence-Number: 19969 Angelo Nicolosi wrote: > It's possible that the problem is in my C code but every time that I'm > allocating memory, using always the palloc() function, I'm always > calling the pfree(). > There is some way to analyze the code meanwhile is working inside the > Postgre server (something like valgrind)? > However the command free -m on my machine outputs: > > total used free shared buffers cached > Mem: 2010 664 1345 0 157 383 > -/+ buffers/cache: 123 1886 > Swap: 16386 41 16345 > > I think that the swap is enough. > Could you give me some tips about how can I see where is the problem? > Thank you for your help! do you know what query you were making when you ran out of memory? it -appears- it was a postgres server process that was OOM'd. what OS and version are you on (OOM seems to imply its likely linux, since no other OS I'm familiar with would randomly kill processes like that), what version postgres, etc ? also, what are the various memory settings in your postgresql.conf (shared_buffers, work_mem, etc)