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 1q9vYZ-0002x7-09 for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 22:35:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q9vYX-0006Df-Ne for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Jun 2023 22:35:05 +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 1q9vYX-0006DQ-E4 for pgsql-hackers@lists.postgresql.org; Thu, 15 Jun 2023 22:35:05 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1q9vYT-002QLu-1F for pgsql-hackers@lists.postgresql.org; Thu, 15 Jun 2023 22:35:02 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9827bd8e0afso299360566b.1 for ; Thu, 15 Jun 2023 15:35:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1686868496; x=1689460496; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4mdTW3V5tuXyXge1zY8XWs/ADnvaLHQn+qx0qEiwtZU=; b=SJN+ttyvITyJiFfy+Zxzyg8eDhm9eWna/nA6B2G+jBcwj1slEGRRDWmBe+2xBDKqht +OYhcqJxjH1rZ/4JNVjGb1f/qX7ZoZetZf0dICcoohPrg2KoZOKLfUE9JjHDHD7rgdum rGxCLHOCCbSZbm26hOQjIWdDz0cqNPj09TbM4PLRrSuwSiJNT3W5gcLOEOuHTjXKw1V6 06fllZxkE6p26WenVwGWinjUwZKE7PC262DHhmzlz5jsU+2ASrL2UNsYhfJ/R7KT9XBl mWcohmIK9wurmhReXVxrYBuCjGqngnxkPC2JYCtFn8yEV9tZvIh7LNu7UlJwBSfJZKIX c/8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686868496; x=1689460496; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4mdTW3V5tuXyXge1zY8XWs/ADnvaLHQn+qx0qEiwtZU=; b=HfHIxTuBm2ITZE5g2nn8KCAlankwlYLmn8t+44/a/coW6qg1TkZfQWoYrDkk8qGQ1p PdRCCjpz7V2qGCFgLdXD14YCug9s4YhdDUPFNyUWIUXlUE66zKiSpf6HObPEhNVgOPzn zlQ4+r594wWEfMhZX/KxDNpEFwaTmII+KrAotN2j3tgFztHbXiR7f/D31hMF1kyPsHyQ v0aZKKX4LCh5DlUYwXxtpwUncaAF3QmtsV26aUG+Ie9byioSUJoaW9ivI5U+n3MF5C4f bkZEk45tlxXN+6GoFK8EO0Gl76rKCmnX/bRwDaLoDmgNZsjTPHtveG++/7U4BdOYcDAU kmmw== X-Gm-Message-State: AC+VfDx10LoZdQZzdTkSCoBAXMhhTQLvNyCFqsuLbUc06VROVYJ/yIJ2 4DCvyZjawkhW/eYA+EaGobkhbg== X-Google-Smtp-Source: ACHHUZ42fBRsC7v0OR/hnqw1T2iz6nX5D5k61RHYswospUdJmsP3ZdLKAblDxMOS+Th43+YbeoZDaw== X-Received: by 2002:a17:907:7e9f:b0:96f:be1e:bf1d with SMTP id qb31-20020a1709077e9f00b0096fbe1ebf1dmr271410ejc.69.1686868496365; Thu, 15 Jun 2023 15:34:56 -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 p14-20020a170906140e00b009786ae9ed50sm9874287ejc.194.2023.06.15.15.34.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jun 2023 15:34:55 -0700 (PDT) Message-ID: Date: Fri, 16 Jun 2023 00:34:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Memory leak in incremental sort re-scan To: Tom Lane Cc: Laurenz Albe , 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> Content-Language: en-US From: Tomas Vondra In-Reply-To: <2275724.1686861393@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company