You are here: Browse Railsplugins Bleak House
BleakHouse
A library and Rails plugin for finding memory leaks.
LicenseCopyright 2007 Cloudburst, LLC. See the included LICENSE file. Portions copyright 2006 Eric Hodel and used with permission. See the included LICENSE_BSD file.
FeaturesRequirements
= Usage
InstallationFirst, install the plugin in your Rails app: ./script/plugin install svn://rubyforge.org/var/svn/fauna/bleak_house/trunk
You need to compile the BleakHouse patched Ruby build. In the plugin directory, run: rake ruby:build
This gives you a Ruby binary named ruby-bleak-house alongside your regular binary.
(BleakHouse is also available as a gem: sudo gem install bleak_house. If you use the gem, require 'bleak_house' in config/environment.rb. You will also have to manually install the bleak_house:analyze Rake task.)
Profiling a Rails appTo profile your application (ideally, in production mode, on an actual application server): RAILS_ENV=production BLEAK_HOUSE=true ruby-bleak-house ./script/server
Browse around manually, thrash your entire app with a script, target troublesome controllers/actions, etc.
Then, to analyze: RAILS_ENV=production rake bleak_house:analyze
And then look in log/bleak_house/.
= Extras
OptionsYou also can set the SMOOTHNESS environment variable if you want. The SMOOTHNESS setting just averages frames together. This is not a rolling average: 10 frames become 5 at SMOOTHNESS=2.
Using BleakHouse outside of RailsIf you want finer snapshots than every action, or want to use the plugin outside of Rails, see the BleakHouse::CLogger class.
TroubleshootingIf you see the error Symbol not found: _rb_gc_heaps_used, it means you installed the patched binary, but tried to profile the server with the regular binary.
You may get library require errors if you install ruby-bleak-house 1.8.6 alongside a different verson of Ruby. You could try to patch your local version of Ruby instead, or you could just upgrade to 1.8.6, which has a good trackrecord of stability.
Reporting problems
NOTE: This description has been extracted from the Plugin README and so the formatting may need updating to make browser friendly