-
-
28 Jan 2016 04:43:45 UTC
- Distribution: Test-Memory-Cycle
- Module version: 1.06
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (2)
- Testers (10857 / 1 / 0)
- Kwalitee
Bus factor: 1- 98.10% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (8.72KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Devel::Cycle
- Getopt::Long
- PadWalker
- Test::Builder
- Test::Builder::Tester
- Test::More
- Test::Simple
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Test::Memory::Cycle - Check for memory leaks and circular memory references
VERSION
Version 1.06
SYNOPSIS
Perl's garbage collection has one big problem: Circular references can't get cleaned up. A circular reference can be as simple as two references that refer to each other:
my $mom = { name => "Marilyn Lester", }; my $me = { name => "Andy Lester", mother => $mom, }; $mom->{son} = $me;
Test::Memory::Cycle
is built on top ofDevel::Cycle
to give you an easy way to check for these circular references.use Test::Memory::Cycle; my $object = new MyObject; # Do stuff with the object. memory_cycle_ok( $object );
You can also use
memory_cycle_exists()
to make sure that you have a cycle where you expect to have one.FUNCTIONS
memory_cycle_ok( $reference, $msg )
Checks that $reference doesn't have any circular memory references.
memory_cycle_exists( $reference, $msg )
Checks that $reference does have any circular memory references.
weakened_memory_cycle_ok( $reference, $msg )
Checks that $reference doesn't have any circular memory references, but unlike
memory_cycle_ok
this will also check for weakened cycles produced with Scalar::Util'sweaken
.weakened_memory_cycle_exists( $reference, $msg )
Checks that $reference does have any circular memory references, but unlike
memory_cycle_exists
this will also check for weakened cycles produced with Scalar::Util'sweaken
.AUTHOR
Written by Andy Lester,
<andy @ petdance.com>
.BUGS
Please report any bugs or feature requests to
bug-test-memory-cycle at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Memory-Cycle. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Test::Memory::Cycle
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
Thanks to the contributions of Stevan Little, and to Lincoln Stein for writing Devel::Cycle.
COPYRIGHT
Copyright 2003-2016 Andy Lester.
This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License v2.0.
See http://www.perlfoundation.org/artistic_license_2_0 or the LICENSE file that comes with the Test::Memory::Cycle distribution.
Module Install Instructions
To install Test::Memory::Cycle, copy and paste the appropriate command in to your terminal.
cpanm Test::Memory::Cycle
perl -MCPAN -e shell install Test::Memory::Cycle
For more information on module installation, please visit the detailed CPAN module installation guide.