detecting memory leaks in Perl

Discussion in 'Perl Misc' started by Jerome Sui, Jul 13, 2003.

  1. Jerome Sui

    Jerome Sui Guest

    What's a good way of detecting memory leaks in Perl ?

    Does the following pattern introduce a garbage collection problem ?


    package Some::ObjectObserver;
    use Some::Object;
    sub new {
    my $self = bless {}, shift;
    $self->{objects} = [Some::Object->new(sub {$self->onEvent})];
    return $self;
    }
    sub onEvent {
    }
    1;
    __END__

    package Some::Object;
    sub new {
    my $self = bless {}, shift;
    $self->{onEvent} = shift;
    return $self;
    }
    1;
    __END__
    Jerome Sui, Jul 13, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ASP.Confused

    ASP.NET - Detecting memory leaks

    ASP.Confused, Jul 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,741
    Marina
    Jul 16, 2004
  2. Jive

    Detecting memory leaks

    Jive, Nov 21, 2004, in forum: Python
    Replies:
    2
    Views:
    378
    Eddie Parker
    Nov 21, 2004
  3. Diego Martins
    Replies:
    4
    Views:
    317
    Diego Martins
    Oct 9, 2006
  4. Ilias Lazaridis

    Detecting memory leaks on apache, mod_python

    Ilias Lazaridis, Dec 17, 2007, in forum: Python
    Replies:
    14
    Views:
    579
    Ilias Lazaridis
    Dec 23, 2007
  5. Replies:
    5
    Views:
    1,015
Loading...

Share This Page