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 1qG1a2-0005Df-Rj for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Jul 2023 18:13: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 1qG1a1-0003qU-QX for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Jul 2023 18:13:49 +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 1qG1a1-0003qL-Hc for pgsql-hackers@lists.postgresql.org; Sun, 02 Jul 2023 18:13:49 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qG1Zy-001ngE-ID for pgsql-hackers@lists.postgresql.org; Sun, 02 Jul 2023 18:13:48 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fb4146e8deso54083465e9.0 for ; Sun, 02 Jul 2023 11:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1688321624; x=1690913624; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EzHgJVcByuLML03Mn9MV4t0Ea2HIrL8hHFXvgblrgew=; b=Ds4Zi7Ua+uzOQBdBodA8uM4/K6edGXnSqtTGav62l/OW3o7/6r3C2TlP6yugfbD61v fTA2GSgzzDQp+X9CdxzOzkpFL8LfMsOReusnD3bGIM3Pi/m7a2PMx9Aw2ZLvsSXjszml 3MBwkMsu4LXkn++AnkpMh+bJ8lgAT48IwNtqvZ1ta2lu0FgGuZZIKM5/XRJXo460GGql nBP9g+Mqtn5BwksNF+e0SJfBlneTY+HhOePYY5u+1GsagTgW79k3c5CYFcHqBYIzRIAv CUd/ey8EbbbELx9M5rM0QYhR4KZhFLF+sBtaRP/Pj/N2EeJMtDWHFMXcTe6TAXw1NFPd mStA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688321624; x=1690913624; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EzHgJVcByuLML03Mn9MV4t0Ea2HIrL8hHFXvgblrgew=; b=Zyz6fE/OLXQkj/TcACMFygNe1KQhZov7shJ4bTNI1LM4ebrHxf/5llfWZbf5v7+x9C +MnTsYbrIF4sR/ADT/UczioxcILzfqOmMrNh+FtbZPClTea9znt/xD0hRmv0I7H7k4HV zO7G3nIbbqthrMDRBeTNyzvmVQBOKiyoKdIyluwwVshuK/f7m8IRn8r6xFRuLcP33T9s /xxhOY5XCH6Gz3oJGaNl2ACyjR0YL1RzNtydgxxXlyvFI6uhaVtMMsEnHWfY61WODkKs 3bSFuNAiCiBKBAGbpzjwqVzvHn2ARk9LRWcJ7dwxGaAumhYHzKze3evwvIK8aUEDKJ2l x3DQ== X-Gm-Message-State: AC+VfDyId2um5+lrPfit2E71WHk9mgedmZaCpBAjg3m7amZgvWr12DzX 4ZmPtlal2OuHaaICoFCSmKedLQ== X-Google-Smtp-Source: ACHHUZ71YMi4H9SHeFJDzajoMnTdLXmkqSR7DzZQ9wh6cxf46feXffG8fscx9ERchXbphAttEEB2+g== X-Received: by 2002:a7b:cd13:0:b0:3fb:4053:a9d5 with SMTP id f19-20020a7bcd13000000b003fb4053a9d5mr10458443wmj.25.1688321623814; Sun, 02 Jul 2023 11:13:43 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-228-220.bb.vodafone.cz. [86.49.228.220]) by smtp.gmail.com with ESMTPSA id w10-20020a1cf60a000000b003f9bd9e3226sm24625367wmc.7.2023.07.02.11.13.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Jul 2023 11:13:43 -0700 (PDT) Message-ID: <53b1274b-454e-6c89-1864-0df6ead5af1b@enterprisedb.com> Date: Sun, 2 Jul 2023 20:13:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: Memory leak in incremental sort re-scan Content-Language: en-US To: Laurenz Albe , Tom Lane Cc: pgsql-hackers@lists.postgresql.org 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> <1eeeebf37fda63cf0946e9b77e5bd6a8ac827615.camel@cybertec.at> From: Tomas Vondra In-Reply-To: <1eeeebf37fda63cf0946e9b77e5bd6a8ac827615.camel@cybertec.at> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/29/23 13:49, Laurenz Albe wrote: > 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 quick >>>>> hack.  (It might be better to make the check in the caller, or to just >>>>> move the call to ExecInitIncrementalSort.) >>> >>>> Thanks for looking. Are you planning to work on this and push the fix, >>>> or do you want me to finish this up? >>> >>> I'm happy to let you take it -- got lots of other stuff on my plate. >> >> OK, will do. > > It would be cool if we could get that into the next minor release in August. > FWIW I've pushed the fix prepared by James a couple days ago. Thanks for the report! regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company