Subject: avoiding a problem that postmaster is suddenly killed by OOM-Killer

From: Toru SHIMOGAKI <[email-masked]>
Date: Fri, 02 Mar 2007 21:00:11 +0900

Hello all,

To avoid a problem that postmaster is suddenly killed by OOM-Killer, some
techniques are described in "16.4.3. Linux Memory Overcommit"
http://www.postgresql.org/docs/8.2/interactive/kernel-resources.html#AEN19362

 One way to avoid this problem is to run PostgreSQL on a machine where you can
 be sure that other processes will not run the machine out of memory.

 On Linux 2.6 and later, a better solution is to modify the kernel's behavior
 so that it will not "overcommit" memory. This is done by selecting strict
 overcommit mode via sysctl:

This description may be misread, at least to me, because OOM-Killer's behavor
has nothing to do with overcommit mode. It is true that turning overcommit off
is one of the solutions but it is not enough: OOM-Killer is invoked whenever
physical memory is exhausted not only by user application but also by in-kernel
working. I checked it with some kernel hackers on Linux-2.6.9-42 (RHEL4 Update4).

I think that to avoid this problem, "increasing swap area" should be added on
this manual. Increasing both physical memory and swap area is easy to
understand,  but increasing physical memory is not software solution.

Best regards,

-- 
Toru SHIMOGAKI<[email-masked]>

---

From: Jim Nasby <[email-masked]>
Date: Mon, 5 Mar 2007 18:38:27 -0600

> understand,  but increasing physical memory is not software solution.

Good idea; care to submit a patch? :)
--
Jim Nasby                                            [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

---

From: Toru SHIMOGAKI <[email-masked]>
Date: Tue, 06 Mar 2007 15:58:43 +0900

> Good idea; care to submit a patch? :)

Yes, I'll submit a patch as soon as possible.