Hacker News new | past | comments | ask | show | jobs | submit login
Visualizing memory leaks in Ruby (cirw.in)
45 points by cirwin on March 4, 2013 | hide | past | favorite | 9 comments



Great project. I hope the community can make good use of this to make sure the different libraries and gems and pieces of code leak as much memory as possible.

Thank you for putting the work in and making Ruby better.


Did you mean "leak as little memory as possible"? Though, some days it seems like the opposite, I admit...


No, he did not, this is what is commonly referred to as a joke.


A better title might be "visualizing the object-reference graph in Ruby;" debugging memory leaks is a neat side effect. That being said, it's an interesting little project.


An unfortunate header, innit? One wonders whether to parse it as "(Visualizing memory leaks) in Ruby" or as "Visualizing (memory leaks in Ruby)".


In this case both are true, no? :)


I randomly stumbled across this gist by tenderlove https://gist.github.com/tenderlove/4576780 that displays references as a tree view using d3.js. I think that this gist in particular is pointing out a bug in that the "references" for Fixnums (also Symbols) in an array aren't returned by ObjectSpace.find_references.


Ruby 2.0 has a similar feature built in, although round the other way: ObjectSpace.reachable_objects_from(obj) .. coupled with ObjectSpace.memsize_of() this can be used to do some memory leak analysis.

We also get GC.stat[:total_allocated_object] and GC.stat[:total_freed_object]


Interesting project. Ruby memory leaks really are brutal!




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: