Re: Limit allocated memory per session

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: daveg <daveg(at)sonic(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Limit allocated memory per session
Date: 2009-10-01 14:49:15
Message-ID: 20091001144915.GB5607@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

daveg wrote:
>
> I'd like to propose adding a new GUC to limit the amount of memory a backend
> can allocate for its own use. The problem this addresses is that sometimes
> one needs to set work_mem fairly high to get good query plans for large joins.
> However, some complex queries will then use huge amounts of memory so that
> one or a few of them will consume all the memory on the host and run it deep
> into swap or trigger the oom killer or worse.

Oh, BTW, did anyone get interested in adding the bits to disable the OOM
killer for postmaster on the various Linux initscripts? It needs some
games with /proc/<pid>/oom_adj and requires root privileges, but I think
an initscript is in an excellent position to do it.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2009-10-01 15:02:03 Re: CommitFest 2009-09, two weeks on
Previous Message Robert Haas 2009-10-01 14:48:57 Re: navigation menu for documents