in reply to Need Help gettng Devel::Leak working (or Devel::LeakTrace)

$handle is an output parameter; it is just a integer pointing to a block of memory that Devel::Leak::NoteSV is using to store its internal table. The documentation should probably read:

use Devel::Leak; ... setup code my $handle; my $count = Devel::Leak::NoteSV($handle); ... code that may leak Devel::Leak::CheckSV($handle);

Also, be aware that most production builds of Perl do not have -DDEBUGGING turned on, and that the Devel::Leak documentation says:

Note that you need a perl built with -DDEBUGGING for sv_dump() to print anything, but counts are valid in any perl.
So, if you were expecting Devel::Leak::CheckSV to give you the details of the leaking objects (as I was when I played with it), you may be disappointed. You can use `perl -V | grep DEBUGGING` to check your build.

Replies are listed 'Best First'.
Re^2: Need Help gettng Devel::Leak working (or Devel::LeakTrace)
by boysenberry (Acolyte) on Aug 20, 2005 at 21:38 UTC
    That is a problem for me actually. I'm using an OS X box and tried recompiling in the past with little success.

    Is there another way to track down leaked scalars?

    I have been able to get the mod_perl debugger working via
    httpd -X -DPERLDB
    The "Attempt to free unreferenced scalar" errors I get are on apachectl stop or restart.