From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 387E91F44D for ; Thu, 29 Feb 2024 11:48:00 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 53B027EFFE; Thu, 29 Feb 2024 11:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1709207265; bh=jVg5n5QDa05ALmMsl0y1jg16ICrTpaKR7nGgv0W3TPE=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=g5yk/LXPoaqXtYfJgaKXyOM50DFfqMvVi3NAWgCai6dkzZERgl2H2GCvSaKS9y5Pq sbJMEaoc2xkmXILGoB8aDM/m2HALFzfH5vRBWQ8GM4e9l2IA94HRM0FiONDekwefTy Ni7tWZarZGrnXA+a3i92DyXFYTjR8Vszyhi6DvUg= Received: from s.wfbtzhsw.outbound-mail.sendgrid.net (s.wfbtzhsw.outbound-mail.sendgrid.net [159.183.224.105]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 5649E7EFEE for ; Thu, 29 Feb 2024 11:47:40 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=sUuiO1fP; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=Xva+BgD7rsRPfTZJy+1WDlCyqD6sG33zHWg6o9T8MmQ=; b=sUuiO1fPOROPC1Y4IwRAlSVtXLrvilaI1Q5LKSHed5IPgzKj0TFDTUOYF3rbquYIqqJM ZVouzHMF9wt/Iw0ybGhOhV3YAFsTYqLuxom1lEdJZYQSJbnmPGCou/i2jrL1e6wn0Dbf04 h1XtlPZ7zsECUXNdt8zFEtkKsh9/KcSMU+mu8jS4MUVNca11d5YhDkKxBYrKwL/cVxykUM TN3fe19mTk4RwNe+ZybBgNICTNcjBXgplp6Evm1zoxLmqhMP86Rq1dCBWwLaRxfN0Kppxg plGU3ElurIsK1jJx258gMerop9aBwWnnW4CBNieitgBcuj5DaxIJ9p674+Bc7Dqg== Received: by filterdrecv-58bfc74dd6-8dt6p with SMTP id filterdrecv-58bfc74dd6-8dt6p-1-65E06EDB-D 2024-02-29 11:47:39.384841512 +0000 UTC m=+3015064.377695217 Received: from herokuapp.com (unknown) by geopod-ismtpd-20 (SG) with ESMTP id B0NZwMPFQA6Rr9D3gX3kYw for ; Thu, 29 Feb 2024 11:47:39.231 +0000 (UTC) Date: Thu, 29 Feb 2024 11:47:39 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20311 X-Redmine-Issue-Author: MaxLap X-Redmine-Issue-Priority: Normal X-Redmine-Sender: byroot X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 93572 X-SG-EID: =?us-ascii?Q?Dq8GNIcVqP8cs5uR+EIAabfg3LE9XdC6dZ5KYNrMpf6VzBWG6HqArcu5raQjXL?= =?us-ascii?Q?IGTFdxKHUt7++67+KD54pNYXheirMcsUIf3sdgF?= =?us-ascii?Q?Riq06gshGe1Tf+IGatVNZB3ck9VsZw03au3atgA?= =?us-ascii?Q?2TtGnMDpGHGqU66C2LeO+vKF0I6goOynWdjkQ00?= =?us-ascii?Q?UiTspSWKBfC1XSk7FHzx93dMQ=2F=2FOsPUQVnpqrji?= =?us-ascii?Q?oWH8MwZvadtfzJFDI1C0tEh4tQk8=2FVOQ0pehco2?= =?us-ascii?Q?NrrIk2albxmukYjE+GtgA=3D=3D?= To: ruby-dev@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: UWENHKHGQZZDCCAJTUJKXQNDXOAUX4CM X-Message-ID-Hash: UWENHKHGQZZDCCAJTUJKXQNDXOAUX4CM X-MailFrom: bounces+313651-12dc-ruby-dev=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: "Ruby developers (Japanese)" Subject: =?utf-8?q?=5Bruby-dev=3A52073=5D_?= [Ruby master Bug#20311] Struct.new("A") memory leak? List-Id: "Ruby developers (Japanese)" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "byroot (Jean Boussier) via ruby-dev" Cc: "byroot (Jean Boussier)" Issue #20311 has been updated by byroot (Jean Boussier). > But I also wonder why we have this root in the first place, I'd think these get marked from being constants in ::Object. Nevermind, if I understand correctly, it's not to mark them, it's to pin them. ---------------------------------------- Bug #20311: Struct.new("A") memory leak? https://bugs.ruby-lang.org/issues/20311#change-107074 * Author: MaxLap (Maxime Lapointe) * Status: Open * ruby -v: 3.3.0 * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- The following code gives the impression of a memory leak. ``` 10.times do 5000.times do Struct.new("A") Struct.send(:remove_const, :A) end GC.start puts `ps -o rss= -p #{$$}`.to_i end ``` ``` 27868 35324 43400 51472 58676 66144 73764 81196 88512 95752 ``` Is there another location where the struct gets set that I need to clear up for the GC free the memory? Happens in 3.2.2, 3.2.3, 3.3.0, 3.3-head, ruby-head. -- https://bugs.ruby-lang.org/