bleak_house 3 tells you your leaks

BleakHouse 3:

  ...
  58%: core rails (783 births, 1241 deaths, ratio -0.23, impact 1.66)
  66%: recipe/new/GET (15182 births, 14593 deaths, ratio 0.02, impact 1.77)
  75%: core rails (766 births, 1168 deaths, ratio -0.21, impact 1.60)
  83%: recipe/list/GET (16423 births, 15991 deaths, ratio 0.01, impact 1.64)

65992 births, 66458 deaths.

Tags sorted by immortal leaks:
  recipe/show/GET leaks, averaged over 4 requests:
    5599 String
    80 Array
    2 Regexp
    2 MatchData
    2 Hash
    1 Symbol
    ...
  core rails leaks, averaged over 4 requests:
    238 String
    10 Array

Tags sorted by impact * ratio:
   0.0739: recipe/show/GET
   0.0350: recipe/new/GET
   0.0218: recipe/list/GET
  -0.6686: core rails

That’s a Symbol up there; the new BleakHouse walks the sym_tbl as well as the regular heap. We now track the history of every individual object instead of just class counts. This means we can accurately (fingers crossed) identify where lingering objects were spawned.

On the flipside, analyzing the log file is slow (a decent-sized logfile will have hundreds of millions of rows). I wrote a pure-C CSV parser, which helps, and there’s always the “better hardware” answer. I’ve been mainly running it on my Mac Mini; if I use the Opteron 2210 it goes much faster, since the analyzer is CPU-bound.

It doesn’t make pretty graphs anymore but I’m not sure exactly how they would help. It would be easy enough to add them back.

go go go

A gem, not a plugin, because it needs to compile a C extension. First, uninstall the old versions to prevent version problems:

sudo gem uninstall bleak_house -a -i -x

Now:

sudo gem install bleak_house

Also, you need to rebuild your ruby-bleak-house binary, even if you already have one. Just run:

bleak --build

The RDoc has updated usage instructions.

21 Comments

  1. Posted September 25, 2007 at 10:10 AM | Permalink

    I think the RubyGem mirrors may be behind. It shows up when searching

    $ gem search –r bleak_house* REMOTE GEMS *
    Bulk updating Gem source index for:
    http://gems.rubyforge.orgbleak_house (7.1, 7, 6, 5.3, 5.2, 5.1, 5, 3.1, 3.0.2, 3)

    But fails to install…

    $ sudo gem install –r bleak_house –v 3.0.2
    ERROR:  While executing gem … (OpenURI::HTTPError)
       404 Not Found

    Come on Rubyforge! I only have so long on lunch!

  2. Posted September 25, 2007 at 11:20 AM | Permalink

    Get it from here if you’re still having trouble. You also will need Ccsv.

  3. Posted September 25, 2007 at 7:10 PM | Permalink

    I just want all you programmers out there to know just how hard this guy works, and how little time I get to actually see him. For the good of the cause I guess…. ;-)

  4. Posted September 26, 2007 at 11:16 AM | Permalink

    Is it 3.2 or 3.0.2?

    Still cant find on gem mirrors…

  5. Posted September 26, 2007 at 11:31 AM | Permalink

    Karl: Use the direct links to the two gems, above. 3.2 is the latest. I’ve filed a Rubyforge ticket about the mirrors being messed up.

    Martha: Soon ;)

  6. Posted September 26, 2007 at 2:29 PM | Permalink

    evan: Make sure you remove that “anonymous girlfriend” spam… :P

  7. Posted September 26, 2007 at 2:44 PM | Permalink

    Oh, snap!

    By the way, the gem mirrors are fixed.

  8. Posted September 30, 2007 at 12:20 PM | Permalink

    Evan: Line 42 in build.rb is a tiny bit mangled:

    exec(“rm #{binary}; cp ./ruby #{binary};
    chmod–755 #{binary}; echoe \”  Done\"")

    chmod doesn’t need ‘–’ and echoe is the olde fashioned command, nowe deprecated :)One other thing, wget doesn’t exist on my mac–no prob, I modded it to use curl–but you might want to use curl by default.

  9. Posted September 30, 2007 at 4:14 PM | Permalink

    Oops! Fixed in trunk. I’ll switch to curl, too.

    There’s another bug in the queue, so once I fix that, I’ll update the gem.

  10. Posted October 1, 2007 at 4:06 PM | Permalink

    ld is throwing up errors when it tries to make bleak_house. Here’s the error: http://pastie.caboo.se/102696

    Ideas?

  11. Posted October 1, 2007 at 5:16 PM | Permalink

    Ah; crap; ld is trying to link against the generic ruby binary rather than the ruby-bleak-house one.

    I’ll figure something out.

  12. Posted October 3, 2007 at 6:11 PM | Permalink

    Actually, it looks like you’re using Leopard? I don’t know how to fix compilation against the bundled package (also, I don’t have Leopard). If you install Ruby from MacPorts you should be ok.

  13. Posted October 9, 2007 at 3:46 AM | Permalink

    Just thought I’d tell you that on my system (Ubuntu) I had to remove the ‘&’ characters from the system calls in “/usr/lib/ruby/gems/1.8/gems/bleakhouse-3.2/lib/bleakhouse/support/build.rb” to be able to use “bleak—build”. The ‘&’ forks the command so that the script continues without waiting for the command to complete, which causes the following commands to fail.

  14. Posted October 9, 2007 at 11:27 AM | Permalink

    Strange that &> would background rather than redirect STDERR. Are you not using Bash, maybe?

  15. Posted October 13, 2007 at 8:56 AM | Permalink

    I was able to successfully install bleak_house on my main dev machine running Tiger.

    You’ve got 2 weeks to release a version that’s Leopard compatible. :-P

  16. Posted October 14, 2007 at 11:49 AM | Permalink

    I think you mean, Apple has two weeks to make sure the Leopard Ruby build isn’t confused like the Tiger one was. :)

  17. Posted October 15, 2007 at 12:17 AM | Permalink

    Yes, I am using bash, so my conclusion would be that the ruby interpreter uses another shell.

  18. Posted October 15, 2007 at 8:47 AM | Permalink

    Hmm, well, I definitely can’t reproduce it. What does ruby –e ‘puts `env | grep SHELL`’ say? And perhaps bash —version?

    I changed the &> in BleakHouse 3.3 to > and 2>&1; maybe that will work better for you.

  19. Posted November 29, 2007 at 11:35 AM | Permalink

    I think that it might have to do with leopard building things universal by default… I’m not sure. But even with ARCHFLAGS=”-i386″ it’s not happy.

    suzaku:~ travis$ ruby-bleak-house
    require 'rbconfig'
    -:1:in `require': no such file to load -- rbconfig (LoadError)
    	from -:1
    
  20. Posted November 29, 2007 at 8:28 PM | Permalink

    I’m getting this error when trying to use it with Rails Edge:

    /var/www/apps/XXXX/releases/20071130025107/vendor/rails/activesupport/lib/
      active_support/core_ext/module/aliasing.rb:31:in
    `alias_method': undefined method `process' for class `Class' (NameError)
    	from /var/www/apps/XXXX/releases/20071130025107/vendor/rails/
    activesupport/lib/active_support/core_ext/module/aliasing.rb:31:in
    `alias_method_chain'
    	from /usr/lib64/ruby/gems/1.8/gems/bleak_house-3.5.1/lib/bleak_house/
              rails/action_controller.rb:9
    

    Any ideas?

  21. Posted December 3, 2007 at 11:36 AM | Permalink

    Please report these bugs on the forum; it’s easier to handle them there.

Follow

Get every new post delivered to your Inbox.

Join 66 other followers