ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:99474] [Ruby master Feature#17103] Add a :since option to ObjectSpace.dump_all
@ 2020-08-04  8:26 jean.boussier
  2020-08-12  7:55 ` [ruby-core:99569] " ko1
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jean.boussier @ 2020-08-04  8:26 UTC (permalink / raw)
  To: ruby-core

Issue #17103 has been reported by byroot (Jean Boussier).

----------------------------------------
Feature #17103: Add a :since option to ObjectSpace.dump_all
https://bugs.ruby-lang.org/issues/17103

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
----------------------------------------
Patch: https://github.com/ruby/ruby/pull/3368

This is useful to see 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 I have to dump the entire 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 generations dumps, and avoid having to do the diff.




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-18 14:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-04  8:26 [ruby-core:99474] [Ruby master Feature#17103] Add a :since option to ObjectSpace.dump_all jean.boussier
2020-08-12  7:55 ` [ruby-core:99569] " ko1
2020-08-12 12:31 ` [ruby-core:99570] " jean.boussier
2020-08-24  4:49 ` [ruby-core:99678] " ko1
2020-08-24  7:35 ` [ruby-core:99679] " jean.boussier
2020-08-27  0:19 ` [ruby-core:99718] " ko1
2020-08-27  7:33 ` [ruby-core:99726] " jean.boussier
2020-08-31  8:48 ` [ruby-core:99792] " matz
2021-01-18 14:36 ` [ruby-core:102138] " jean.boussier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).