On Fri, Jul 18, 2008 at 12:18 AM, Francisco Reyes <lists@xxxxxxxxxxxxxxxx> wrote: > Douglas McNaught writes: > > >> It does seem that reducing work_mem might help you, but others on this > > I reduced it from 256MB to 64MB. It seems it is helping. You should also look at your memory overcommit settings (in /proc/sys/vm). You can set things up so that Postgres gets a malloc() failure (which it is generally prepared to cope with cleanly) when the system runs out of RAM, rather than having the OOM killer go off and hit it with SIGKILL. Overcommit is useful in some contexts (Java apps tend to map a lot more memory than they actually use) but for a dedicated database server you really don't ever want to have the OOM killer triggered. -Doug