Devel::GC::Helper - Perl extension for finding unused variables


Devel-GC-Helper documentation Contained in the Devel-GC-Helper distribution.

Index


Code Index:

NAME

Top

Devel::GC::Helper - Perl extension for finding unused variables

SYNOPSIS

Top

  use Devel::GC::Helper;
  my $leaks = Devel::GC::Helper::sweep;
  foreach my $leak (@$leaks) {
      print "Leaked $leak";
  }

DESCRIPTION

Top

This module walks the entire perl space, from main:: and notes what it has found, then it walks all SVs that are active and tells you which ones are potential leaks.

EXPORT

None by default.

sweep()

Returns an arrayref of references to all containers that it didn't find in the mark phase.

SEE ALSO

Top

This module can be used together with Devel::Cycle to find where there is a leak.

You can trac the repository at http://code.sixapart.com/trac/Devel-GC-Helper/

BUGS

Top

Will only work in threaded perl correctly, it won't find regular expressions in non threaded perl because it is not walking the op tree. Nor will it find constants.

Leaked regular expressions won't be reported, because I can't figure out how to tell if they are active or not, I also haven't looked closely at it since I don't have much of a problem with leaking regexen.

There are three variables, tvo magic elements and one array that I have not tracked down where they come from that are always reported as leaked. I suspect they are from within DynaLoader/Exporter.

AUTHOR

Top

Artur Bergman, <sky@crucially.net>

COPYRIGHT AND LICENSE

Top


Devel-GC-Helper documentation Contained in the Devel-GC-Helper distribution.

package Devel::GC::Helper;

use 5.008006;
use strict;
use warnings;

require Exporter;

our @ISA = qw(Exporter);
our %EXPORT_TAGS = ( 'all' => [ qw(
                                   sweep
                                   ) ] );

our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

our @EXPORT = qw();

our $VERSION = '0.25';

require XSLoader;
XSLoader::load('Devel::GC::Helper', $VERSION);


1;
__END__
# Below is stub documentation for your module. You'd better edit it!