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=0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (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 E850A1F44D for ; Thu, 29 Feb 2024 12:08:12 +0000 (UTC) Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id AB4677F006; Thu, 29 Feb 2024 12:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1709208477; bh=MeGD/xXhs6iIcDUA4UUffm06M67EejJ6jVidnGU7nQw=; 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=LgOSHfiEqThsC6kiV9hqj1jyXuGoKfeHN+z19jYI20ETrEuX2q+krfjQnS8eFLRTz UaQ7DeocdjnGnryuUFs8P+itLDpfInLquMzPcOZkoilOU+Oz+4gwgbclu0/nzZafcd Nc1h8Og7/l69ZLaDGtnrPpADW660HVK32bGOyMy4= Received: from s.csnrwnwx.outbound-mail.sendgrid.net (s.csnrwnwx.outbound-mail.sendgrid.net [198.37.146.154]) by nue.mailmanlists.eu (Postfix) with ESMTPS id E8D957EFFA for ; Thu, 29 Feb 2024 12:07:51 +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=hhwoCnO0; 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=W35WIoxQy80KsB+nbrzeIxSSIof0++3OkrTpSIXNzZ8=; b=hhwoCnO0ZMcjvsG6FFxCFzUwils6YkjZ1opEpHebCvihFKJIlUHYWNJoajML3rapstCz HmdLx0smWhN5jskNM1kcJvzp01xIbji0xK/MIZaLrrLjxAbEXkJAJ9tfLSHCMD5dfDrg0U BB2WbmRollqUli+UAJm8ZKweFhRGoaqShFdacbVt/AFjn+Pfv1FkGotHZoJ5XZZvr87vdD KYxE0fCEjkrtvMoZ736RkYMBvBtokd8LvTBLNMkKZ4PthI7a5Xo8G8AdtndY8p3knBdMYg HHEtaMtyQ0Sz721joK/r//IuYb6qN6sqOY3qr/oN4o1MP0gPLWzFMpfeG1bQjI9w== Received: by recvd-7ffbd89f59-vp6sb with SMTP id recvd-7ffbd89f59-vp6sb-1-65E07396-1 2024-02-29 12:07:50.007641934 +0000 UTC m=+51492.162651629 Received: from herokuapp.com (unknown) by geopod-ismtpd-29 (SG) with ESMTP id Gse0sr1VTg-8YElKX7Rw_Q for ; Thu, 29 Feb 2024 12:07:49.945 +0000 (UTC) Date: Thu, 29 Feb 2024 12:07:50 +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: 93573 X-SG-EID: =?us-ascii?Q?Dq8GNIcVqP8cs5uR+EIAabfg3LE9XdC6dZ5KYNrMpf6VzBWG6HqArcu5raQjXL?= =?us-ascii?Q?IGTFdxKHUt7++67+KD54pNYXheirMcsUIf3sdgF?= =?us-ascii?Q?Riq06hUv+jnzYJvbi7peiSvd=2FPSqqOau1i38FnN?= =?us-ascii?Q?JDzUPBMyOKR2byCpqdAFAXZtDCMnLs0lxQGO45J?= =?us-ascii?Q?SlXc5baLQ85tTSl0ApjfJhd0JSzUdTn+hKJhBg9?= =?us-ascii?Q?VA7nod4n0AwqtyMwD45oTeEZ+chFtyWtw4HBE6r?= =?us-ascii?Q?ZlScSI=2FAnEqKhApdtTYcw=3D=3D?= To: ruby-dev@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: AW7ZX5THUMPCMZDEBTXP374FGSOKHWQT X-Message-ID-Hash: AW7ZX5THUMPCMZDEBTXP374FGSOKHWQT 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=3A52074=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). I think https://github.com/ruby/ruby/pull/10143 will do. But a good followup would also be to not pin `Struct.new("A")`. ---------------------------------------- Bug #20311: Struct.new("A") memory leak? https://bugs.ruby-lang.org/issues/20311#change-107075 * 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/