Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Making Devel::Leak useful

by brycen (Monk)
on Mar 21, 2009 at 00:14 UTC ( [id://752171]=perlquestion: print w/replies, xml ) Need Help??

brycen has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to get a test script working, to determine if Devel::Leak will actually be useful for me:
#!/usr/bin/debugperl -w # http://www.perlmonks.org/?node_id=642604 use strict; use Devel::Leak; use Scalar::Util qw/weaken/; my ($handle); leak(); my $test1 = "foo"; my $count1 = Devel::Leak::NoteSV ($handle); leak(); $test1 = undef; my $count2 = Devel::Leak::CheckSV($handle); print "$count1 $count2\n"; exit(0); sub leak { for (1..3) { my $h = {}; $h->{myself} = $h; #weaken($h->{myself}); $h->{label} = 'testing $_'; } }
I'm using the debian package perl-debug, which has compile-time options: DEBUGGING MULTIPLICITY PERL_IMPLICIT_CONTEX. But I see no difference in the output with the debug perl, despite the wisdom of the monks at node_id=642604 and node_id=485409 and node_id=447341. All I get is hex addresses, and I don't see the destruction of "foo" which was stored in $test1:
debugperl test_mem_leak1.pl new 0x79b490 : new 0x79b4a0 : new 0x79b4b0 : new 0x79b4c0 : new 0x79b4d0 : new 0x79b4e0 : new 0x79b4f0 : new 0x79b500 : new 0x6c7290 : 3014 3023
Is there a way to peek inside the leaks?

Replies are listed 'Best First'.
Re: Making Devel::Leak useful
by brycen (Monk) on Apr 09, 2009 at 21:23 UTC
    I found my own answer, posted here in hopes it saves someone else trouble: Devel-Leak-0.03, the current release from CPAN is buggy. Devel-Leak-0.04, an unauthorized release, is what you want.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://752171]
Approved by linuxer
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found