Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecE5n-0006En-It for pgsql-admin@arkaria.postgresql.org; Thu, 18 Jan 2018 17:35:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecE5m-0002YG-VZ for pgsql-admin@arkaria.postgresql.org; Thu, 18 Jan 2018 17:35:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecE5m-0002Xn-OH for pgsql-admin@lists.postgresql.org; Thu, 18 Jan 2018 17:35:10 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ecE5i-0001wc-Ta for pgsql-admin@lists.postgresql.org; Thu, 18 Jan 2018 17:35:10 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 2938FC04EB; Thu, 18 Jan 2018 17:35:04 +0000 (UTC) Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo01-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8FvjfMd5usRC; Thu, 18 Jan 2018 17:35:04 +0000 (UTC) Received: from shr-mbp-2.local (unknown [8.39.228.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 28DD3C04D1; Thu, 18 Jan 2018 17:35:01 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: Abnormally high memory usage/OOM triggered From: scott ribe In-Reply-To: <15a90b55-5151-ce22-16ee-7ff883e5eb97@gmail.com> Date: Thu, 18 Jan 2018 10:34:59 -0700 Cc: pgsql-admin@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <460E4952-3C5F-4A17-A426-09FD0249FF82@elevated-dev.com> References: <4d52fee7-73ba-16a9-9c27-8ae5107ee6ae@gmail.com> <5E0AB8DB-F13B-41BF-843A-FE64FBE9C097@elevated-dev.com> <15a90b55-5151-ce22-16ee-7ff883e5eb97@gmail.com> To: Davlet Panech X-Mailer: Apple Mail (2.3445.5.20) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Jan 18, 2018, at 10:13 AM, Davlet Panech wrote: >=20 > On 1/17/2018 5:57 PM, scott ribe wrote: >> On Jan 17, 2018, at 2:57 PM, Davlet Panech wrote: >>>=20 >>> Does my configuration look reasonable? I just don't understand how = it could possibly use up 19 GB of memory based on the configuration = below. Is there a memory leak in there somewhere? >> It does seem awfully high, but... An update can involve a join across = multiple tables. Or an update can run a trigger which can cascade. = Either of those could result in an "accidental cross product" join, = which can always blow up memory. > There must be a way to put an upper limit on memory even for such = cases. I was under the impression that parameters such as "work_mem" = serve that purpose, is that not the case? So an "accidental cross = product" join's memory usage is unbounded? It can't be... could somebody = confirm this please? You are correct as far as I know, so yeah, that case should result in = filling disk, not RAM -- Scott Ribe https://www.linkedin.com/in/scottribe/ (303) 722-0567