4 ms·
I really like the ObjectSpace.trace_object_allocations addition. I had a quick look at the 2.1 docs for ObjectSpace and there seem to be all sorts of interestin
by conorh 13y ago
I really like the ObjectSpace.trace_object_allocations addition. I had a quick look at the 2.1 docs for ObjectSpace and there seem to be all sorts of interesting methods in there reachable_objects_from(obj) and memsize_of(obj) for example. It looks like understanding memory usage and tracking down memory leaks will get a lot easier with 2.1.
http://ruby-doc.org/stdlib-2.1.0/libdoc/objspace/rdoc/ObjectSpace.html#method-c-trace_object_allocations http://ruby-doc.org/stdlib-2.1.0/libdoc/objspace/rdoc/Object...
- matsadler 13y ago#reachable_objects_from was added in 2.0, and I think #memsize_of was introduced in one of the 1.9 releases. The documentation is new though. I wrote a little about them here: http://globaldev.co.uk/2013/03/ruby-2-0-0-in-detail/#id6 http://globaldev.co.uk/2013/03/ruby-2-0-0-in-detail/#id6
- conorh 13y agoAh nice, thanks, missed the part about requiring "objspace" to mix them in and assumed they would be on the already existing ObjectSpace module.