summaryrefslogtreecommitdiff
path: root/ext/objspace/lib/objspace.rb
AgeCommit message (Collapse)Author
2023-02-19[DOC] Improve ObjectSpace#dump_XXX method docszverok
* 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) Notes: Merged: https://github.com/ruby/ruby/pull/7316
2022-12-12[DOC] Fix format in ObjectSpace.dump_allPeter Zhu
2022-12-12[DOC] Fix format for ObjectSpace.dump_shapesPeter Zhu
2022-12-12[DOC] Fix call-seq for ObjectSpace methodsPeter Zhu
2022-12-12[DOC] Fix typo in docs for ObjectSpace.dump_allPeter Zhu
2022-12-12[DOC] Fix indentation for ObjectSpace.dump_allPeter Zhu
2022-12-08ObjectSpace.dump_all: dump shapes as wellJean Boussier
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. Notes: Merged: https://github.com/ruby/ruby/pull/6868
2020-10-03Fix ObjectSpace.dump(obj, output: :stdout)Kazuhiro NISHIYAMA
RDoc says `ObjectSpace.dump(obj, output: :stdout) # => nil`, but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe. I think it is unintentional change. Notes: Merged: https://github.com/ruby/ruby/pull/3620
2020-09-15Parse ObjectSpace.dump_all / dump arguments in Ruby to avoid allocation noiseJean Boussier
[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. Notes: Merged: https://github.com/ruby/ruby/pull/3530