Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nP8zn-0002Qd-6W for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Mar 2022 20:21:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nP8zm-0007dg-1Z for pgsql-bugs@arkaria.postgresql.org; Tue, 01 Mar 2022 20:21:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nP8zl-0007dX-P0 for pgsql-bugs@lists.postgresql.org; Tue, 01 Mar 2022 20:21:17 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nP8zi-0000Tn-Pb for pgsql-bugs@lists.postgresql.org; Tue, 01 Mar 2022 20:21:16 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9B7185C01AC; Tue, 1 Mar 2022 15:21:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 01 Mar 2022 15:21:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=kO8TDVKlXvSERK99XHsVLxTrFcsvC9EXiCbeEu aBpPs=; b=ikZCZZ2fJuklWUHLvTWHMDWfoCKbj8S70tcOEBcrHGLrk2EQObJWtt 1l18J2y6D1JV4aLskg2yZr39fyqI6Ap0rEJto+NbwLKqjtbyAH4XCnhOXUPbo6V7 fv8ptD6nI7tfF87poLsz3Ihp5HDco6wR3FDJoWd2KjDjiMH77r12uQ437YYilXdI qBUt9F/YHBHkdLbAEqBdSX89AoXYTsAvHuF8zUbTJbI8Jkh7Vzokyu0+3t9VFgTL CKSC/waG0wVg8lYoJtA8Q6fkBGNGEJOs1JQQlyPsXoEgHmERegggRuZorJjO/vRf PJeIGbs9+bWnR5f+JFMyuHILNlyGl7Ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=kO8TDVKlXvSERK99X HsVLxTrFcsvC9EXiCbeEuaBpPs=; b=MCGRNhFxwhk2JhNtM7Yi9j6iCagdj7Cpr 5R0b8WLcpIAx5nXmbEAa5+yRY6QAb26prmbOtJ0VGhbFzcVTCk07ASwe+rUBFTky G9/+iLOqJA2pcefvq2BNc7F1NDyIglCiNsH58hG5H4dovxlFGyX3wCMWYcLWAcl7 PrnrZ44y4h8FfAnhJcC0fptR0vsMoTT4J1vx4SNFb2l7Vrilglz4SPW/Fnl+Ffk0 kHGcMa8CGDynyQaetKJUoX0vbqDrdolTl7Y0rIUmAh7WZVzOrV1s/58T2VzdZiGr dPB92yEAti/ibuj/GARAXsa+Pa/U5s2dzLjy+0eunSr5Opv20GC9Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddtvddgudefvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpeetnhgurhgvshcuhfhrvghunhguuceorghnughrvghssegr nhgrrhgriigvlhdruggvqeenucggtffrrghtthgvrhhnpeevffejhfeugfeviedvffefud fgjeeiteevhedtfeelieetteeivdeiudelgffggeenucffohhmrghinhepghhithhhuhgs rdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Mar 2022 15:21:13 -0500 (EST) Date: Tue, 1 Mar 2022 12:21:12 -0800 From: Andres Freund To: vitstn@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17422: Memory leak Message-ID: <20220301202112.f6dc5ooory7tqdir@alap3.anarazel.de> References: <17422-6a5f554d27f8ff39@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17422-6a5f554d27f8ff39@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-03-01 17:06:02 +0000, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 17422 > Logged by: Vitaly Stoyan > Email address: vitstn@gmail.com > PostgreSQL version: 13.6 > Operating system: any > Description: > > https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/utils/adt/json.c#L83 > > It seems memory allocated by palloc for lex variable isn't freed In a lot of places we free memory in bulk by resetting memory contexts. See https://github.com/postgres/postgres/blob/master/src/backend/utils/mmgr/README Greetings, Andres Freund