Garbage Collection and the Ruby Heap
timetobleed.com
timetobleed.com
Thanks for the link.
In any event, keep up the free education! I've learned alot going through your site. Oh, and thanks for some great ruby libraries!
Any chance of a video of this talk being released? I'd love some commentary from you guys.
I think his notes demonstrate how wildly the 'optimal' settings for a scripting runtime can vary based on use case - 500K slots in a slab makes perfect sense for rails, but 10K also makes pretty good sense for running ruby from the command line to execute a tiny script.
One thing that caught my eye - I think according to slide 52, at startup a rails app is using over 3625840 bytes of heap just to represent newline nodes generated from source code? Am I interpreting the data right, or is he just counting the actual nodes and not the RVALUEs attached to them? Kind of funny to think about optimizing memory usage in a rails app by stripping out superfluous newlines.
Unfortunately, removing newlines from your codebase will not help since NODE_NEWLINE is used for separators like semicolons as well.
Ruby 1.9 gets rid of NODE_NEWLINE altogether by adding a NEWLINE flag to the next node instead. A similar patch will be in the next release of REE.
> and memoryhungriest language in common use today
I think you've never heard of Perl.
Any links for that? (Not trolling: I use both Perl and Ruby day to day, and I'm curious. I certainly haven't noticed significant differences in memory usage. Speed certainly - Perl being faster in many cases.)
Both are so much slower than C that a 2x difference is insignificant.