Devel::LeakTrace - indicate where leaked variables are coming from.


Devel-LeakTrace documentation Contained in the Devel-LeakTrace distribution.

Index


Code Index:

NAME

Top

Devel::LeakTrace - indicate where leaked variables are coming from.

SYNOPSIS

Top

  perl -MDevel::LeakTrace -e '{ my $foo; $foo = \$foo }'
  leaked SV(0x528d0) from -e line 1
  leaked SV(0x116a10) from -e line 1

DESCRIPTION

Top

Based heavily on Devel::Leak, Devel::LeakTrace uses the pluggable runops feature found in perl 5.6 and later in order to trace SV allocations of a running program.

At END time Devel::LeakTrace identifies any remaining variables, and reports on the lines in which the came into existence.

Note that by default state is first recorded during the INIT phase. As such the module will not pay attention to any scalars created during BEGIN time. This is intentional as symbol table aliasing is never released before the END times and this is most common in the implicit BEGIN blocks of use statements.

CAVEATS

Top

glib is used for it's hash manipulation routines to keep state. This is an external dependency that is hoped can be removed, but tuits as yet haven't presented themselves.

TODO

Top

Elminate dependency on glib

Improve the documentation.

Clustering of reports if they're from the same line.

Stack backtraces to suspect lines.

AUTHOR

Top

Richard Clamp <richardc@unixbeard.net> with portions of LeakTrace.xs taken from Nick Ing-Simmons' Devel::Leak module.

COPYRIGHT

Top

SEE ALSO

Top

Devel::Leak, Devel::Cover


Devel-LeakTrace documentation Contained in the Devel-LeakTrace distribution.

package Devel::LeakTrace;
use strict;
require 5.006;
use base 'DynaLoader';

BEGIN {
    our $VERSION = 0.05;
    bootstrap Devel::LeakTrace $VERSION;
    hook_runops();
}


INIT {
    reset_counters();
}

END {
    show_used();
}

1;

__END__