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 1kS1ls-0003TZ-OL for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Oct 2020 17:38:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kS1lr-0002zd-KY for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Oct 2020 17:38:03 +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 1kS1lr-0002zW-EN for pgsql-bugs@lists.postgresql.org; Mon, 12 Oct 2020 17:38:03 +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 1kS1lp-00025Z-CO for pgsql-bugs@lists.postgresql.org; Mon, 12 Oct 2020 17:38:02 +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 09CHbpA33197648; Mon, 12 Oct 2020 13:37:52 -0400 From: Tom Lane To: bchen90@163.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16666: Slight memory leak when running pg_ctl reload In-reply-to: <16666-2c41a4eec61b03e1@postgresql.org> References: <16666-2c41a4eec61b03e1@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 12 Oct 2020 13:32:13 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3197646.1602524271.1@sss.pgh.pa.us> Date: Mon, 12 Oct 2020 13:37:51 -0400 Message-ID: <3197647.1602524271@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form writes: > I found slighting memory leakage occured when running pg_ctl reload command > for the following code segment(guc.c:6726-6740). When runing 'pg_ctl > reload', for these string type PGC_POSTMASTER GUC variables like > 'unix_socket_directories', the following code segment will leak newval's > memery. Yeah, you're right. If there's a "newextra" chunk, that'll get leaked too. Even counting that, it's not very plausible that one would SIGHUP a server often enough that the bloat would become obvious, since these values typically aren't very large. But it's clearly a bug. Patch applied, thanks for the report! regards, tom lane