dike-0.0.4.rb

NAME

  dike

SYNOPSIS

  a simple memory leak detector for ruby with preconfigured rails
hooks.

INSTALL

  gem install dike

URIS

  http://www.codeforpeople.com/lib/ruby/
  http://rubyforge.org/projects/codeforpeople/

DESCRIPTION

  the concept behind dike.rb is simple: class Object is extended in
order that
  the location of each object's creation is tracked. a summarizer
command is
  given to walk ObjectSpace using each object's class and the location
if it's
  creation to detect memory leaks. not all leaks can be detected and
some that
  are may not really be leaks, but dike provided a simple way to see
the
  hotspots in your code that may potentially be leaking.

HISTORY

  0.0.4:

    - under rare circumstances dike itself interacted strangely with
certain
      classes and caused them to leak, HTTPOK was one such example.
this
      release fixes that bug. thanks to Jan Kubr for providing a
great test
      case that helped me fix this.

EXAMPLES

  ### PURE RUBY

   ## just dumping sequential snapshots to stderr, looking at a
specific class

    # cfp:~ > cat sample/a.rb
        require 'dike'

        class Leak < ::String
        end

        Leaks = Array.new

        Dike.filter Leak

        loop do
          Leaks << Leak.new('leak' * 1024)
          Dike.finger
          sleep 1
        end

    # cfp:~ > ruby sample/a.rb | less