Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wWQuR-002bsy-1Y for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jun 2026 03:44:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wWQuQ-000VWL-1Q for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jun 2026 03:44:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wWQuP-000VWC-27 for pgsql-hackers@lists.postgresql.org; Mon, 08 Jun 2026 03:44:18 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wWQuM-00000001pwX-3eI5 for pgsql-hackers@lists.postgresql.org; Mon, 08 Jun 2026 03:44:17 +0000 Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id 1221CEC01C4; Sun, 7 Jun 2026 23:44:12 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sun, 07 Jun 2026 23:44:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1780890252; x=1780976652; bh=LZpvstnFxm wnQVmuLkclpicaFsDMMAUMYvrE+h1KRDM=; b=yDpmmdDhv8hiQ1/hNqaywWym1b N2tgDvxSeunQBArDboafR3VoMq01A4wFDsc9kBdEOh7nskTvgO/LrN7Rywe0529J 88DtrhzCbG4g8mi1gTUO+vPveQdnMJ+4ICX5Rp6Avyii9oigu1b+vXzqoimLj8/2 tIXXmS78HIwAd7aV7EemCUtkpoi94gkJ9kknqGtPXLpLH3QlKNVHLhYbDlsvgxNt rRM6ghR0KaFMf/HoSdiuqgGCmJAw+89xtTjLS40Y8Gm/8kaXBPxRrFihPlcOvp+W K++6Vivkj4jnD8YdvC9LVqPbSeFaft6mPqmHCpUvnkp9r+M6lt1FzDdx55GA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1780890252; x=1780976652; bh=LZpvstnFxmwnQVmuLkclpicaFsDMMAUMYvr E+h1KRDM=; b=bw5LsCbLG/1WsuWToxT+YKiyhm8FG0xmgbBWA2EcW+eRSv8fi6Y ig5OWg6lJ5COmX1ax5bVrImLtp4zxsPMEduVHBSRPxqRIk2MrjShC7tK9hqqZbXm gZJe2Mv4MFDGd+2uDW5t5JDc7tlxCxDgzKYOKHdAYB9hnaEwEBzcJcELqI5oidbg kBqdJ/MUZK8+LVrwM70x34iKhvWmGSYfxUXBHHgQOYPDcMsRjoh2HroOq+kP1aGA 9gGrG/L3KDtD1PdMgOPxc/gd3wnPTRUXOg03UQRrpE9JuYVC5Bdq0jma8MfaD2uM uo1IOCVWOCLU5Y+yoGke1RBAggrxuleoBWQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEIno57vzQPibWWVSW5qv/mXczhYONxZQ48ZkrTwan6dKbA1dX+8xTCrBCC4MjtND r9t08oJo0N45csPbac8u8NTDZ4Uid3/sFhjYf8Qt742eBL8Od6c4IoVv/ExLpPKdfw9G3Z 80StTiXen1sKjoaPZqOCL6AEvNpNGGfT6dNPIRK8/YvyvkUjBwkaPZ8hJteKM8VakY7l3b PFQyW05yvIyp1DdTw3PIOgRUu+vyVRTMOmKQUdh4jUyVALXC5d0YrJShhq7iUfIXB6tXkG A/XYpCIPm/HNPP/vZOAiFU/ipJNYTHvgSp3u+jA0OdT+bFQNAUvCEMbi0dK9uF28A5JbKT iV+gQGOPGqhJulEZYezOtnXa0wO57RQxjIcXyDtPHNFm31e3IuiH/+J91tplFqvofLgdyb QZUG1KPo58JFUAReuuPqyeRxS50CUe8+nTXIytBaa1T9jBWiFcYARCmdXCNrc/WUCLXTWq 5wPzi1qfofUggiP/bwH9Ysrh2r8Xyvjs+DYVRe0Efki2rz4PQdcRhe+mXH9zDZ63hyjfRt cdOA9kOLMdgmxE8UPsad6qYMEopMRQ3ss2fxRFAUCq1gJy/uOv2L4ZE1DB+E045M8Cs5y+ 7GyQBu17Kp4cR5IHQxRrapHzz+mhFSJvd4q4XEok7yxXOuvgnsUbzwVsyp/g X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 Jun 2026 23:44:10 -0400 (EDT) Date: Mon, 8 Jun 2026 12:44:05 +0900 From: Michael Paquier To: Sami Imseih Cc: Baji Shaik , Tristan Partin , bertranddrouvot.pg@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param() Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ZWknU4PJB7atdWfx" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ZWknU4PJB7atdWfx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 06, 2026 at 09:55:05AM -0500, Sami Imseih wrote: > Hi, >=20 > good find, and thanks for the patches! >=20 > > 0001: drop the redundant initStringInfo() call (backport candidate) >=20 > This one looks like an obvious fix to me. And clearly something that should be backpatched down to v17, or we could pile a lot of memory depending on how many calls we do in a worker, with more piling over time. Will process, thanks! >> 0002: allocate the static buffer once per process via >> pq_beginmessage_reuse / pq_endmessage_reuse, to avoid the >> per-call allocation (master only) >=20 > I am less convinced this will have any benefits for the additional comple= xity. > The callers of pgstat_progress_parallel_incr_param() are not frequent eno= ugh > to make a measurable difference here. cost delay reporting for parallel w= orkers > is throttled by PARALLEL_VACUUM_DELAY_REPORT_INTERVAL_NS and > index progress reporting does not happen very frequently either. I doubt that 0002 is worth doing, particularly seeing the code paths where this is called. -- Michael --ZWknU4PJB7atdWfx Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmomOoUACgkQnvQgOdby QH3UkA//exUgxjvAeQPYu1cUSua71WWLL3Rda0QrlLcFL3Ru+fKhLlUybDrdK0iW F0PcBUR6A7p8ylq6OfznSjAvz2FOvcEylOUa63cif20XYE+2Mm6iXPvNl614DaIn fHrZL4dnxfJMLx7jgFuL4WI98lphaugQl2Y/BNmz8rrBMkJ6lplbIc4r5j+3k6z6 htYaRhlg5C+YSc4RqhC7Rp6I3eZ9SN5NB6qIsG4rYVBuxW7hu3bDulkqCPjq83No Xp07s8eLLB5a05sKNpP3ckN8u6y8VrnOyLBdj6BOGA8lAXd1dQkEoWoabWH2l4iZ gKYNb2XxgRwZgQ4JPduoyLfYyQ6sPcd5tV30G0YWO3b02ao3+AbjcSw61GBGRtkx uCvIQXKkI8gOvCtWzyQpCFFIoyruhdzSqhsbWeYleHp0VdRUbaSlOqK6Xf+DTD9w oQTo7KpMg8LeJpvS+iN5aYyrHZ5kSfCA8eZiWAyX/Zs169Kjb1Z0hjh+Al5OBt/1 ql7UdKJBuRYSN0Ew/9TyLyBESOZpI1GMPZzIvrLG124usCPWn3VUXq+eiBYJDJ7D uZjCqkp1zoFVAiBNfZ6cMjsqkR2B75m/AR0KXRwA2bfb4uEK+o8fYLXC44md8IR1 ku5NgJlOXa6vcdLcQpLUq5yqu27qwqGm0GzTpJUSw2mluDKyWx4= =2XTi -----END PGP SIGNATURE----- --ZWknU4PJB7atdWfx--