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 1myAMj-0006Zz-Ow for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Dec 2021 10:21:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1myAMi-0002wj-H5 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Dec 2021 10:21:28 +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 1myAMi-0002wa-6n for pgsql-hackers@lists.postgresql.org; Fri, 17 Dec 2021 10:21:28 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1myAMb-0005VC-JP for pgsql-hackers@lists.postgresql.org; Fri, 17 Dec 2021 10:21:27 +0000 Received: by mail-wr1-x431.google.com with SMTP id j18so3122022wrd.2 for ; Fri, 17 Dec 2021 02:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aiven.io; s=google; h=from:to:cc:subject:date:message-id:organization:in-reply-to :references:mime-version:content-transfer-encoding; bh=n5TG/bjHRTYkdAZRInTrZf5cfWnezIus6OgpttAhcig=; b=K0dfgzOKLBLXxv4SXhr+W3iY9AoeWFnI2rufkk+9xKpvnXRRFongIA8rgfzcCYpNqa yEYSaEL/sOM1EBD5NifNNIvS9aH1rinp8NOVSL51Q8q1hRcznh/ySJ928hkt33H5PAaK aKP4JmNhzDegtGXRmYnri+3G2xVq35lC5sAJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :in-reply-to:references:mime-version:content-transfer-encoding; bh=n5TG/bjHRTYkdAZRInTrZf5cfWnezIus6OgpttAhcig=; b=ShU0uzSvnjoGK4B4TCER6wYMws2QsUbYh6ZjfLfL2f5dbWNjNfWgd9UZYXy/S2A53z OqRmhe9FLwM6+JXZuYUNF20Tniw8wSTZSj2KzEtpMurRqEkmYoc3u50qjk8oxf2IQz8Y jJzyGzWkLRcguGBkjFldN1n5ReKzpI/s6Um7qHkTJW+oGNZxcmRyPwxWfXPHbVqHmGJQ rTruj+9+7dKKd12HuZ3Er8R+4sTU3P6SHvPAqWoHRczjkOphT91SmgX4/cv2rGBn2nd1 EZY31DaLv3i5KwSiLlPnyas0Ro3lBHnqr2TZsVuhdJ5asHhQGmyKDr5rXzGxPjMafLr/ PosQ== X-Gm-Message-State: AOAM530Hosrqxopr2ZxodLjS9ArhTi0Q4qWZ2COvQSFlPT2Pwkrk7cKf Be0XEtfy0w7Nm6Qd3WSmHno9ZA== X-Google-Smtp-Source: ABdhPJwb9E1D1rCDQhkzZT63phDWXzPrhywSZbCEB1XjsIE5fIxJ78xSRE/79evaCOmWwbOVD/GQLQ== X-Received: by 2002:adf:eac8:: with SMTP id o8mr1936152wrn.93.1639736480493; Fri, 17 Dec 2021 02:21:20 -0800 (PST) Received: from aivenronan.localnet (static-176-158-121-96.ftth.abo.bbox.fr. [176.158.121.96]) by smtp.gmail.com with ESMTPSA id u9sm6086572wmm.7.2021.12.17.02.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Dec 2021 02:21:20 -0800 (PST) From: Ronan Dunklau To: David Rowley , pgsql-hackers@lists.postgresql.org, Tomas Vondra Cc: Andres Freund , Tomas Vondra Subject: Re: Use generation context to speed up tuplesorts Date: Fri, 17 Dec 2021 11:20:11 +0100 Message-ID: <4697108.irdbgypaU6@aivenronan> Organization: aiven In-Reply-To: <7285172.GXAFRqVoOG@aivenronan> References: <70b689dc-7ad4-138c-2c0b-9fcc131a1aaf@enterprisedb.com> <7285172.GXAFRqVoOG@aivenronan> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Le vendredi 17 d=E9cembre 2021, 09:08:06 CET Ronan Dunklau a =E9crit : > It is my understanding that malloc will try to compact memory by moving it > around. So the memory should be actually be released to the kernel at some > point. In the meantime, malloc can reuse it for our next invocation (which > can be in a different memory context on our side). I've been told off-list this comment wasn't clear: I meant that it compacts= =20 *free* memory, consolidating into larger blocks that will eventually reach = the=20 threshold, and be released. =2D-=20 Ronan Dunklau