Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYGi6-0006Yz-RI for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2013 14:43:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VYGi5-0007AF-Gz for pgsql-bugs@arkaria.postgresql.org; Mon, 21 Oct 2013 14:43:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYGht-0006uY-Nu for pgsql-bugs@postgresql.org; Mon, 21 Oct 2013 14:43:45 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VYGhq-0008OZ-3x for pgsql-bugs@postgresql.org; Mon, 21 Oct 2013 14:43:45 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 800105F783; Mon, 21 Oct 2013 10:47:26 -0400 (EDT) Date: Mon, 21 Oct 2013 10:47:26 -0400 From: Stephen Frost To: Frank van Vugt Cc: Valentine Gogichashvili , PostgreSQL Bugs Subject: Re: array_agg() on a set larger than some arbitrary(?) limit causes runaway memory usage and eventually memory exhaustion Message-ID: <20131021144726.GF2706@tamriel.snowman.net> References: <3839201.Nfa2RvcheX@techfox.foxi> <2334937.gaPyc11YQv@techfox.foxi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="69fJlC/pgaAOOQL6" Content-Disposition: inline In-Reply-To: <2334937.gaPyc11YQv@techfox.foxi> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.8.0-25-generic (x86_64) X-Uptime: 10:44:11 up 100 days, 10:53, 11 users, load average: 0.01, 0.03, 0.05 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.3 (--) 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 --69fJlC/pgaAOOQL6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Frank van Vugt (ftm.van.vugt@foxi.nl) wrote: > Op zaterdag 19 oktober 2013 21:02:25 schreef Valentine Gogichashvili: > > this is a little bit not relevant to the question itself. But to preven= t OOM > > killer from currupting your database please consider this for your > > production environments: >=20 > Sure, I understand why you'd want to mention this 'on the side', but I'm = aware=20 > of OOM-tuning. In production, I use it wherever it's _really_ needed, but= mind=20 > that the oom-killer in newer kernels is already selecting processes a bit= =20 > smarter than it used to. In the example I gave, the correct child process= was=20 > killed. The correct child being killed doesn't actually mean that it's a *good idea* to kill off PG child processes, in general, particularly in the way that the OOM killer goes about it (kill -9). If it was possible to tune the OOM killer to use a different signal, which would allow PG to actually clean things up, it *might* be reasonable to allow it, but I still wouldn't recommend it. In production, for my part, proper memory accounting (and disabling of OOM) should *always* be used. Thanks, Stephen --69fJlC/pgaAOOQL6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEUEARECAAYFAlJlPn4ACgkQrzgMPqB3kij8ywCghPCiZ/mJFEcAJQRU4EKImevk JG8AmKkUJpRkc+O/kbD67drk4AIFuRs= =UaLS -----END PGP SIGNATURE----- --69fJlC/pgaAOOQL6--