<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/objspace/lib/objspace.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[DOC] Improve ObjectSpace#dump_XXX method docs</title>
<updated>2023-02-19T20:32:52+00:00</updated>
<author>
<name>zverok</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2023-02-15T20:07:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e1b447a32304495e1379d154758130a8be530bfb'/>
<id>e1b447a32304495e1379d154758130a8be530bfb</id>
<content type='text'>
* remove false call-seq (output from Ruby parsing is cleaner)
* explain output: argument in plain words
* change parameter name in docs of #dump_shapes (typo)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* remove false call-seq (output from Ruby parsing is cleaner)
* explain output: argument in plain words
* change parameter name in docs of #dump_shapes (typo)
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix format in ObjectSpace.dump_all</title>
<updated>2022-12-12T15:16:38+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-12-12T15:16:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5302d04e5a7fe226a4e9f6aba8b681e0d5088b27'/>
<id>5302d04e5a7fe226a4e9f6aba8b681e0d5088b27</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix format for ObjectSpace.dump_shapes</title>
<updated>2022-12-12T15:15:24+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-12-12T15:15:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=be710c1bf797f539707e00a1ec6bf86e6009add0'/>
<id>be710c1bf797f539707e00a1ec6bf86e6009add0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix call-seq for ObjectSpace methods</title>
<updated>2022-12-12T14:58:39+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-12-12T14:58:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a9c3dc8d2ea4f2461862a999ce40cf944af97190'/>
<id>a9c3dc8d2ea4f2461862a999ce40cf944af97190</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix typo in docs for ObjectSpace.dump_all</title>
<updated>2022-12-12T14:56:44+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-12-12T14:56:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=58e3ce5de6e54e4ede6ab6c5df2426ddb92b5a17'/>
<id>58e3ce5de6e54e4ede6ab6c5df2426ddb92b5a17</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[DOC] Fix indentation for ObjectSpace.dump_all</title>
<updated>2022-12-12T14:51:12+00:00</updated>
<author>
<name>Peter Zhu</name>
<email>peter@peterzhu.ca</email>
</author>
<published>2022-12-12T14:51:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=87d54708735a77c867638e3157695d75cab279b3'/>
<id>87d54708735a77c867638e3157695d75cab279b3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>ObjectSpace.dump_all: dump shapes as well</title>
<updated>2022-12-08T17:46:16+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>byroot@ruby-lang.org</email>
</author>
<published>2022-12-06T11:56:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=73771e4b192f3db62efb854affdfc95babba1d35'/>
<id>73771e4b192f3db62efb854affdfc95babba1d35</id>
<content type='text'>
I see several arguments in doing so.

First they use a non trivial amount of memory, so for various memory
profiling/mapping tools it is relevant to have visibility of the space
occupied by shapes.

Then, some pathological code can create a tons of shape, so it is
valuable to have a way to have a way to observe shapes without having
to compile Ruby with `SHAPE_DEBUG=1`.

And additionally it's likely much faster to dump then this way than
to use `RubyVM::Shape`.

There are however a few open questions:

- Shapes can't respect the `since:` argument. Not sure what to do when
  it is provided. Would probably make sense to not dump them.
- Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`?
- Maybe instead `dump_all` should take a `shapes: false` argument?

Additionally, `ObjectSpace.dump_shapes` is added for the use case of
debugging the evolution of the shape tree.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I see several arguments in doing so.

First they use a non trivial amount of memory, so for various memory
profiling/mapping tools it is relevant to have visibility of the space
occupied by shapes.

Then, some pathological code can create a tons of shape, so it is
valuable to have a way to have a way to observe shapes without having
to compile Ruby with `SHAPE_DEBUG=1`.

And additionally it's likely much faster to dump then this way than
to use `RubyVM::Shape`.

There are however a few open questions:

- Shapes can't respect the `since:` argument. Not sure what to do when
  it is provided. Would probably make sense to not dump them.
- Maybe it would make more sense to have a separate `ObjectSpace.dump_shapes`?
- Maybe instead `dump_all` should take a `shapes: false` argument?

Additionally, `ObjectSpace.dump_shapes` is added for the use case of
debugging the evolution of the shape tree.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix ObjectSpace.dump(obj, output: :stdout)</title>
<updated>2020-10-02T15:00:01+00:00</updated>
<author>
<name>Kazuhiro NISHIYAMA</name>
<email>zn@mbf.nifty.com</email>
</author>
<published>2020-10-02T09:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d0a7189f26dcb185c76771823dcfd20d8d4a7e3e'/>
<id>d0a7189f26dcb185c76771823dcfd20d8d4a7e3e</id>
<content type='text'>
RDoc says `ObjectSpace.dump(obj, output: :stdout)   # =&gt; nil`,
but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe.

I think it is unintentional change.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RDoc says `ObjectSpace.dump(obj, output: :stdout)   # =&gt; nil`,
but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe.

I think it is unintentional change.
</pre>
</div>
</content>
</entry>
<entry>
<title>Parse ObjectSpace.dump_all / dump arguments in Ruby to avoid allocation noise</title>
<updated>2020-09-15T16:18:13+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-09-10T11:17:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=fbba6bd4e3dff7a61965208fecae908f10c4edbe'/>
<id>fbba6bd4e3dff7a61965208fecae908f10c4edbe</id>
<content type='text'>
[Feature #17045] ObjectSpace.dump_all should allocate as little as possible in the GC heap

Up until this commit ObjectSpace.dump_all allocates two Hash because of `rb_scan_args`.

It also can allocate a `File` because of `rb_io_get_write_io`.

These allocations are problematic because `dump_all` dumps the Ruby
heap, so it should try modify as little as possible what it is
observing.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #17045] ObjectSpace.dump_all should allocate as little as possible in the GC heap

Up until this commit ObjectSpace.dump_all allocates two Hash because of `rb_scan_args`.

It also can allocate a `File` because of `rb_io_get_write_io`.

These allocations are problematic because `dump_all` dumps the Ruby
heap, so it should try modify as little as possible what it is
observing.
</pre>
</div>
</content>
</entry>
</feed>
