Actions
Bug #9026
closed[PATCH] Add ObjectSpace.heap_dump to objspace.so
Actions
Like0
Like0Like0Like0Like0
Added by tmm1 (Aman Karmani) over 11 years ago. Updated over 11 years ago.
Based on feedback from ko1-san, I have modified the ruby signatures as follows:
call-seq:
ObjectSpace.dump(obj[, output: :string]) # => "{...}"
ObjectSpace.dump(obj, output: :file) # => "/tmp/rubyobj000000"
ObjectSpace.dump(obj, output: :stdout) # => nil
call-seq:
ObjectSpace.dump_all([output: :file]) # => "/tmp/rubyheap000000"
ObjectSpace.dump_all(output: :stdout) # => nil
ObjectSpace.dump_all(output: :string) # => "{...}\n{...}\n..."
If anyone has opinions on these APIs, I'd love to hear them.
I think it could be helpful to be able to specify the filename that the dump should be written to, or at least the directory.
You can use something like this: FileUtils.mv(ObjectSpace.dump_all, "mydumpfile.json")
This issue was solved with changeset r43585.
Aman, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.