Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7C8B19FB35F for ; Fri, 7 Sep 2007 06:38:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 70101-05 for ; Fri, 7 Sep 2007 06:38:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx01.bfk.de (mx01.bfk.de [193.227.124.2]) by postgresql.org (Postfix) with ESMTP id 5366C9FA5CC for ; Fri, 7 Sep 2007 06:38:50 -0300 (ADT) Received: from mx00.int.bfk.de ([10.119.110.2]) by mx01.bfk.de with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) id 1ITaIZ-0003Le-4N; Fri, 07 Sep 2007 11:38:47 +0200 Received: from fweimer by bfk.de with local id 1ITaID-0006iW-1k; Fri, 07 Sep 2007 11:38:25 +0200 To: Gregory Stark Cc: "Richard Yen" , Subject: Re: postgres memory management issues? References: <874pi6zurt.fsf@oxford.xeocode.com> From: Florian Weimer Date: Fri, 07 Sep 2007 11:38:25 +0200 In-Reply-To: <874pi6zurt.fsf@oxford.xeocode.com> (Gregory Stark's message of "Fri, 07 Sep 2007 10:31:34 +0100") Message-ID: <823axqn7ce.fsf@mid.bfk.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/118 X-Sequence-Number: 26663 * Gregory Stark: > You might also tweak /proc/sys/vm/overcommit_memory but I don't remember = what > the values are, you can search to find them. "2" is the interesting value, it turns off overcommit. However, if you're tight on memory, this will only increase your problems because the system fails sooner. The main difference is that it's much more deterministic: malloc fails in a predictable manner and this situation can be handled gracefully (at least by some processes); no processes are killed. We use this setting on all of our database server, just in case someone performs a huge SELECT locally, resulting in a a client process sucking up all available memory. With vm.overcommit_memory=3D2, memory allocation in the client process will fail. Without it, typically the postgres process feeding it is killed by the kernel. --=20 Florian Weimer BFK edv-consulting GmbH http://www.bfk.de/ Kriegsstra=DFe 100 tel: +49-721-96201-1 D-76133 Karlsruhe fax: +49-721-96201-99