detecting memory leaks in Perl

J

Jerome Sui

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__
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top