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 1nKADS-0007Ps-R8 for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Feb 2022 02:38:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKACw-000588-BD for pgsql-bugs@arkaria.postgresql.org; Wed, 16 Feb 2022 02:38: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 1nKACw-00057z-3D for pgsql-bugs@lists.postgresql.org; Wed, 16 Feb 2022 02:38:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKACt-00027t-Sx for pgsql-bugs@lists.postgresql.org; Wed, 16 Feb 2022 02:38:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 21G2cBDb3244454; Tue, 15 Feb 2022 21:38:11 -0500 From: Tom Lane To: Andres Freund cc: Daniel Gustafsson , wliang@stu.xidian.edu.cn, pgsql-bugs Subject: Re: Report a potential memory leak in setup_config() In-reply-to: <3243399.1644978358@sss.pgh.pa.us> References: <64ee7543.20d.17efb1270ca.Coremail.wliang@stu.xidian.edu.cn> <3052163.1644942806@sss.pgh.pa.us> <20220216012953.6d7bzmsblqou3ru4@alap3.anarazel.de> <3239746.1644975946@sss.pgh.pa.us> <20220216022118.vvijtgd5rl2b6ucv@alap3.anarazel.de> <3243399.1644978358@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 15 Feb 2022 21:25:58 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3244452.1644979091.1@sss.pgh.pa.us> Date: Tue, 15 Feb 2022 21:38:11 -0500 Message-ID: <3244453.1644979091@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Yeah, I read that. I think making the backend read these files directly > makes a ton of sense, so I'm no longer very excited about improving the > performance or memory consumption of the replace_token stuff. Actually, wait a second. I grant your point about postgres.bki, but a whole lot of the replace_token calls in initdb are messing with the configuration files, which (a) is something I don't see changing, and (b) pretty much none of that could be pushed back to build time. So even though the config files are a lot smaller than postgres.bki, maybe there's still a point in polishing replace_token a bit. regards, tom lane