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 1pXQtq-0004Ij-SO for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Mar 2023 18:09:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pXQto-0005e6-M7 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Mar 2023 18:09:56 +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 1pXQto-0005X7-C3 for pgsql-hackers@lists.postgresql.org; Wed, 01 Mar 2023 18:09:56 +0000 Received: from mail1.dalibo.net ([51.159.93.128] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXQtm-0004AF-Dy for pgsql-hackers@lists.postgresql.org; Wed, 01 Mar 2023 18:09:55 +0000 Received: from karst (larco.ioguix.net [78.202.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id E3C451F7B5; Wed, 1 Mar 2023 19:09:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1677694185; bh=DUSdRmlB0/18ClkCLykCVR/7naRndn5Mp4FCfcaD/50=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OYcvIUaZVI00e+gvZrvuGr3maEHU0y5OZs7xbabQ+FJo3rbp8RNXqAYDJn2MXkOCr F4ThvviDMLs+k6ehBRPbj+4fUQxa8spwBCFOUkg89mEpp8DcVJ4W+66aIeoe0cp55P ICU6gUtRON7+r0Fe8i8akCJnOb0v2yH2A1taxCUk= Date: Wed, 1 Mar 2023 19:09:44 +0100 From: Jehan-Guillaume de Rorthais To: Tomas Vondra Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Memory leak from ExecutorState context? Message-ID: <20230301190944.56ed0665@karst> In-Reply-To: <20230301184840.0a897a80@karst> References: <20230228190643.1e368315@karst> <45d453c8-b2d3-b477-36eb-32fdf4455f3c@enterprisedb.com> <20230301184840.0a897a80@karst> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 1 Mar 2023 18:48:40 +0100 Jehan-Guillaume de Rorthais wrote: ... > You'll find some intermediate stats I already collected in attachment: > > * break 1, 2 and 3 are from AllocSetAlloc, break 4 is from AllocSetFree. > * most of the non-free'd chunk are allocated since the very beginning, before > the 5000's allocation call for almost 1M call so far. > * 3754 of them have a chunk->size of 0 > * it seems there's some buggy stats or data: > # this one actually really comes from the gdb log > 0x38a77b8: break=3 num=191 sz=4711441762604810240 (weird sz) > # this one might be a bug in my script > 0x2: break=2 num=945346 sz=2 (weird address) > * ignoring the weird size requested during the 191st call, the total amount > of non free'd memory is currently 5488MB I forgot one stat. I don't know if this is expected, normal or not, but 53 chunks has been allocated on an existing address that was not free'd before. Regards,