It’s bleak to have leaks.

third update

Please see here for up-to-date documentation.

second update

There is now a pure-C heap instrumentation as well as the Ruby/ObjectSpace one. You really should be using the C version. It requires you to compile a custom binary, though. Just go to the plugin’s folder (vendor/plugins/bleak_house in your app, or bleak_house-5.1/ in your system’s gems/) and run:

sudo rake ruby:build


I had to junk Rublique because it was introducing its own leaks (via method unbinding) and used an unreliable delta algorithm. Instead the plugin now uses BleakHouse::MemLogger, which is faster and more accurate. Rublique gave me the original idea, so I can’t complain.

A gem version is now available, too. Install and then require 'bleak_house' in config/environment.rb. Usage is the same, but you have to manually install the Rake task in each app (the gem install message will explain).


You can report any issues on the forum. Also, Chris Carter says BleakHouse is starting a trend in emo Ruby-naming.

That’s all. Go scale something already.

9 responses

  1. Neat product! Still trying to get it to work, though. I’m running Rails in Windows XP and the following line puzzles me, because it won’t work from a DOS prompt:

    RAILS_ENV=production BLEAK_HOUSE=true \
      INTERVAL=5 ./script/server

    I assume I need to add these lines to environment.rb:

    BLEAK_HOUSE = true
    INTERVAL = 5

    And then run the web server as I normally would. Am I right?

  2. I figured it out. I put these lines at the bottom of my environment.rb:

    ENV['BLEAK_HOUSE'] = 'true'
    ENV['INTERVAL'] = '5'
    require 'bleak_house'
  3. That should work, although the require might not be necessary. You should also be able to do (at the DOS prompt):


    And I guess to turn it off (assuming you don’t just close the prompt):


    These aren’t tested, since I don’t have a Rails stack installed in Parallels.

    Are you deploying on Windows, too? The closer your testbed is to your actual deployment situation, the more accurate your results will be.

  4. Hmm i get this error:

    Parsing data
    By controller
    magick/annotate.c:917: failed assertion
    `draw_info->text != (char *) NULL'
    Abort trap

    I reinstalled the fonts, ImageMagick, and RMagick, yet no luck. Any ideas anyone?

  5. Yeah upgraded Ruby and gems and gem system etc. and Magick error is gone, but now i get this …

    rake aborted!
    can't convert nil into String
    bleak_house/support_methods.rb:20:in `exists?'

    Hmm it seems to be a problem with the app I tested it on…it works just fine on another app…

    Just scanning through the images…looks great! Neat job!