Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VXh1O-0006f0-Jp for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Oct 2013 00:37:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VXh1M-0001AX-S1 for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Oct 2013 00:37:28 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VXh1M-0001AR-4D for pgsql-bugs@postgresql.org; Sun, 20 Oct 2013 00:37:28 +0000 Received: from mail.gransy.com ([2001:1528:137::f1]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VXh1E-0003UG-IY for pgsql-bugs@postgresql.org; Sun, 20 Oct 2013 00:37:27 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id D5596508C0C for ; Sun, 20 Oct 2013 02:37:19 +0200 (CEST) X-Virus-Scanned: G-Hosting.cz + Station.cz + Klenot.cz + Subreg.cz amavisd-new at antispam.gransy.com Received: from mail.gransy.com ([82.208.44.189]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id pPF3rvYwJDhx for ; Sun, 20 Oct 2013 02:37:20 +0200 (CEST) Received: by mail.gransy.com (Postfix, from userid 5000) id DCA5F508C17; Sun, 20 Oct 2013 02:37:18 +0200 (CEST) Received: from [192.168.1.227] (ip-78-45-139-138.net.upcbroadband.cz [78.45.139.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id BFB28508C0C for ; Sun, 20 Oct 2013 02:37:18 +0200 (CEST) Message-ID: <526325BE.6020501@fuzzy.cz> Date: Sun, 20 Oct 2013 02:37:18 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: array_agg() on a set larger than some arbitrary(?) limit causes runaway memory usage and eventually memory exhaustion References: <3839201.Nfa2RvcheX@techfox.foxi> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, On 19.10.2013 21:02, Valentine Gogichashvili wrote: > Hi Frank, > > this is a little bit not relevant to the question itself. But to prevent > OOM killer from currupting your database please consider this for your > production environments: > http://www.postgresql.org/docs/9.1/static/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT Not sure what's your suggestion? The problem is that the database is actually using the memory, so overcommit is not directly applicable here. He might easily add more swap to "fix" the issue, but it will take ages to actually execute the query because of the overhead. Tomas -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs