From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id F135F1F4B4 for ; Mon, 18 Jan 2021 14:36:52 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 4DF8F120C64; Mon, 18 Jan 2021 23:36:02 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id B3A75120B46 for ; Mon, 18 Jan 2021 23:35:59 +0900 (JST) Received: by filterdrecv-p3las1-d5b58bc9d-6dhld with SMTP id filterdrecv-p3las1-d5b58bc9d-6dhld-19-60059CFF-19 2021-01-18 14:36:47.295405211 +0000 UTC m=+321178.200835298 Received: from herokuapp.com (unknown) by geopod-ismtpd-5-5 (SG) with ESMTP id BgFVIzY0R_eGzuLbxXbGrQ for ; Mon, 18 Jan 2021 14:36:47.075 +0000 (UTC) Date: Mon, 18 Jan 2021 14:36:47 +0000 (UTC) From: jean.boussier@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 78041 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17103 X-Redmine-Issue-Author: byroot 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-SG-EID: =?us-ascii?Q?AchqQMoUBMcQgz7gop0XiYUiatGIY7E61JGsTL4FvjfQrsKmbzvPb5vR4iveLh?= =?us-ascii?Q?WA90x=2FH9UJzVeHrbUMDuqrPTJrAgB4BjZUlUs7+?= =?us-ascii?Q?yVU1+D=2F6YNm9oWBQkAz0tKfLZFUN9y7wAndFrXI?= =?us-ascii?Q?IMRGrNBgN8lqr8S5HRloqcKBpOHTpXqVgtSun74?= =?us-ascii?Q?lGuDsWKFmmne=2FIIonEKA0dQc2HrlHWl5c9=2FbKaV?= =?us-ascii?Q?wogrNT6ZCGdh0vzAM=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102138 Subject: [ruby-core:102138] [Ruby master Feature#17103] Add a :since option to ObjectSpace.dump_all X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17103 has been updated by byroot (Jean Boussier). This was merged in Ruby 3.0 and can now be closed. ---------------------------------------- Feature #17103: Add a :since option to ObjectSpace.dump_all https://bugs.ruby-lang.org/issues/17103#change-89989 * Author: byroot (Jean Boussier) * Status: Open * Priority: Normal ---------------------------------------- Patch: https://github.com/ruby/ruby/pull/3368 This is useful for seeing what a block of code allocated, e.g. ```ruby GC.start GC.disable gc_gen = GC.count ObjectSpace.trace_object_allocations do # run some code end allocations = ObjectSpace.dump_all(output: :file, since: gc_gen) GC.enable GC.start retentions = ObjectSpace.dump_all(output: :file, since: gc_gen) ``` For context, this is what I do in https://github.com/Shopify/heap-profiler, except that I have to dump the entire heap three times and then do a diff. This new API would allow me to dump the entire heap only once and then do two much-faster single-generation dumps without doing the diff. -- https://bugs.ruby-lang.org/