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 1qEq9w-0007dM-9C for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 11:50:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEq9v-0004Wf-2J for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 11:49:59 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEq9u-0004WW-PB for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 11:49:58 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qEq9s-0019uz-6J for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 11:49:58 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-992af8b3b1bso60541366b.1 for ; Thu, 29 Jun 2023 04:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1688039395; x=1690631395; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=ddPuiU/Ybs5q8JQHtLSVftf+qhGA7RywRodwpe5wP/o=; b=dac7/G4GRr/W4570c2ugiKfKuQnqNePfTZBEn45wcuNLiueOQ8WZq1++pSak4ouEiP J6YMpm1Xs0Vb3rPnTLuHPaD9XhTe27KX2CjuPMR7OI4xlPlP7RjqxmKfO81/um+hDtra 2hlczwWWPWWdN6jyKBvLdHI2MeBPyQ3rdY0lLSeRs7WOIud0RHd8wJt9BEAePRrT4OdT 1/r9CANrYLlC83MP3BYnuP4/BJshtqDO8aumBR0nllcqYtmaIXhXprb+vxgxNBv4s1Bc PIZ2lV8SUugoGhWyv+sG6DiAd88x6CBdoXPWtRmOMN506uO7Nl5Delm7BVzSNs7klVQq HxZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688039395; x=1690631395; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ddPuiU/Ybs5q8JQHtLSVftf+qhGA7RywRodwpe5wP/o=; b=KfFzwv4eo61C4dEcgvuQTjMIC/9vKON5OPaNE8MB2PhlNeLuB+U3vWAP4goY/McvYS 0hy6gH7DGsrnZ3lVvvl/TqRPiyM7iuc3n9cWp9rFArDeRWGYfCUGDf9/tTTo3vbLpMR8 mz+2jwKthhMO9o+rlwWMCHi4jcIAJOT0lNoIr7qPAZ9BRte/exav0IP1aQZjdiz7Uc8g x/cX+FeeJ/mVJ4pyTLA/lGugP72C/ESPDorvf/N33yMVjcmTLFJqXipK1Voc/7qaaA1z 0d4nEYbKsd5BMVk9irifG0X7moRUlWZ5PnAn/5tvDwiO4Ve/nHOgONV/KjpI9VGsr5C2 tgUg== X-Gm-Message-State: AC+VfDxs9wo/UUjlUu+7jEWBEqnsprGP5jH7813B51fe9rl+62udHVFc 8L1NMwLJ9780kHPWXHQkvvWlmg== X-Google-Smtp-Source: ACHHUZ7ah4xUuHctrRxZj2xnvAbsWYgeXt99M2DJx2F4EKyYHlo5SGyMn2ks4ckNnm0Wzks3H16x+w== X-Received: by 2002:a17:907:26c2:b0:982:1936:ad27 with SMTP id bp2-20020a17090726c200b009821936ad27mr31697959ejc.11.1688039395327; Thu, 29 Jun 2023 04:49:55 -0700 (PDT) Received: from localhost.localdomain ([2001:620:130:6092:9eaa:2c5c:b1d4:9e96]) by smtp.gmail.com with ESMTPSA id v4-20020a170906180400b009920e9a3a73sm3119442eje.115.2023.06.29.04.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 04:49:54 -0700 (PDT) Message-ID: <1eeeebf37fda63cf0946e9b77e5bd6a8ac827615.camel@cybertec.at> Subject: Re: Memory leak in incremental sort re-scan From: Laurenz Albe To: Tomas Vondra , Tom Lane Cc: pgsql-hackers@lists.postgresql.org Date: Thu, 29 Jun 2023 13:49:54 +0200 In-Reply-To: References: <99e584a1-2f55-a56d-efb1-d38c57eb2beb@enterprisedb.com> <2267955.1686859883@sss.pgh.pa.us> <0643dbc2-53a6-37ac-b567-243a489cef0f@enterprisedb.com> <2275724.1686861393@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2023-06-16 at 00:34 +0200, Tomas Vondra wrote: > On 6/15/23 22:36, Tom Lane wrote: > > Tomas Vondra writes: > > > On 6/15/23 22:11, Tom Lane wrote: > > > > I see zero leakage in that example after applying the attached quic= k > > > > hack.=C2=A0 (It might be better to make the check in the caller, or= to just > > > > move the call to ExecInitIncrementalSort.) > >=20 > > > Thanks for looking. Are you planning to work on this and push the fix= , > > > or do you want me to finish this up? > >=20 > > I'm happy to let you take it -- got lots of other stuff on my plate. >=20 > OK, will do. It would be cool if we could get that into the next minor release in August= . Yours, Laurenz Albe