Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCRQk-0007O6-3Y for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Jun 2016 12:57:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bCRQj-0002mJ-IG for pgsql-bugs@arkaria.postgresql.org; Mon, 13 Jun 2016 12:57:25 +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 1bCRQ6-00023g-04 for pgsql-bugs@postgresql.org; Mon, 13 Jun 2016 12:56:46 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bCRQ1-0005jf-Kc for pgsql-bugs@postgresql.org; Mon, 13 Jun 2016 12:56:45 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7B1782084F; Mon, 13 Jun 2016 08:56:39 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Mon, 13 Jun 2016 08:56:39 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=9WIQRcFcNH+I4D3 YPYq3XGZv7QE=; b=BULaRCBLFl0SsNcRjrteCcUkNgYnN41a9hSwbiq8D7EGcDj LgRJPZLeTGho08Ya55cAE+Y7yeSlLGMHd+8vx/ZBmUuVGcKP905XkuGHs73CjhQf DGp0QgYsAuInCtmZBeKDtBOxpelb4IHxJ9Fp/Sip1nC/rpgC+lbOsKv19fe0= X-Sasl-enc: eOycECqDQ35HjBKpzU8eo4YLbEpHSvbMyXOgvh7q2bJa 1465822599 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 33381F2022; Mon, 13 Jun 2016 08:56:39 -0400 (EDT) Subject: Re: PostgreSQL (9.3 and 9.6) eats all memory when using many tables To: depesz@depesz.com, pgsql-bugs@postgresql.org References: <20160609154610.GA20600@depesz.com> From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <41f45186-64f6-8f9a-c72a-a3e9555d57b1@2ndquadrant.com> Date: Mon, 13 Jun 2016 08:56:56 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160609154610.GA20600@depesz.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 On 6/9/16 11:46 AM, hubert depesz lubaczewski wrote: > Basically it looks that postgresql "caches" query plans? parsed elements? for > queries, but doesn't put any kind of limit to size of this cache. Which means > that if our app is using LOTS of different queries, the memory usage will grow > in time. If you compile with -DSHOW_MEMORY_STATS, it will print out memory allocation after every command, so you might be able to see where the memory is going. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs