snax

ruby performance

rubygems memory patch

This patch against RubyGems 1.1.1 improves memory usage by not keeping every unused gemspec permanently in memory. It should have low CPU impact as long as you do your gem requires up-front.

For MacPorts:

cd /opt/local/lib/ruby/site_ruby/1.8
curl http://blog.evanweaver.com/files/rubygems-memory-1_1_1.diff \
  | sudo patch -p0

Incidentally, I used BleakHouse to track down which references were getting retained.

May 26, 2008

4 comments

_eric says (May 26, 2008):

Very nice patch!

Dr Nic says (May 26, 2008):

Should I be able to gem update --system and get a 1.1.2 release with this? Or is this patch only for RubyGems hackers?

evan says (May 26, 2008):

It's for patching your local or production system.

It removes an API method so I kind of figured it wouldn't get accepted into the official version. Maybe that's bogus.

Add a comment

Various HTML tags allowed. Use <pre> for code blocks and <code> for inline references.