1Cycle(3)              User Contributed Perl Documentation             Cycle(3)
2
3
4

NAME

6       Test::Memory::Cycle - Check for memory leaks and circular memory refer‐
7       ences
8

VERSION

10       Version 1.04
11

SYNOPSIS

13       Perl's garbage collection has one big problem: Circular references
14       can't get cleaned up.  A circular reference can be as simple as two
15       reference that refer to each other:
16
17           my $mom = {
18               name => "Marilyn Lester",
19           };
20
21           my $me = {
22               name => "Andy Lester",
23               mother => $mom,
24           };
25           $mom->{son} = $me;
26
27       "Test::Memory::Cycle" is built on top of "Devel::Cycle" to give you an
28       easy way to check for these circular references.
29
30           use Test::Memory::Cycle;
31
32           my $object = new MyObject;
33           # Do stuff with the object.
34           memory_cycle_ok( $object );
35
36       You can also use "memory_cycle_exists()" to make sure that you have a
37       cycle where you expect to have one.
38

FUNCTIONS

40       "memory_cycle_ok( $reference, $msg )"
41
42       Checks that $reference doesn't have any circular memory references.
43
44       "memory_cycle_exists( $reference, $msg )"
45
46       Checks that $reference does have any circular memory references.
47
48       "weakened_memory_cycle_ok( $reference, $msg )"
49
50       Checks that $reference doesn't have any circular memory references, but
51       unlike "memory_cycle_ok" this will also check for weakened cycles pro‐
52       duced with Scalar::Util's "weaken".
53
54       "weakened_memory_cycle_exists( $reference, $msg )"
55
56       Checks that $reference does have any circular memory references, but
57       unlike "memory_cycle_exists" this will also check for weakened cycles
58       produced with Scalar::Util's "weaken".
59

AUTHOR

61       Written by Andy Lester, "<andy @ petdance.com>".
62

BUGS

64       Please report any bugs or feature requests to "bug-test-memory-cycle at
65       rt.cpan.org", or through the web interface at
66       <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Memory-Cycle>.  I
67       will be notified, and then you'll automatically be notified of progress
68       on your bug as I make changes.
69

SUPPORT

71       You can find documentation for this module with the perldoc command.
72
73           perldoc Test::Memory::Cycle
74
75       You can also look for information at:
76
77       * AnnoCPAN: Annotated CPAN documentation
78           <http://annocpan.org/dist/Test-Memory-Cycle>
79
80       * CPAN Ratings
81           <http://cpanratings.perl.org/d/Test-Memory-Cycle>
82
83       * RT: CPAN's request tracker
84           <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-Memory-Cycle>
85
86       * Search CPAN
87           <http://search.cpan.org/dist/Test-Memory-Cycle>
88

ACKNOWLEDGEMENTS

90       Thanks to the contributions of Stevan Little, and to Lincoln Stein for
91       writing Devel::Cycle.
92
94       Copyright 2006, Andy Lester, All Rights Reserved.
95
96       You may use, modify, and distribute this package under the same terms
97       as Perl itself.
98
99
100
101perl v5.8.8                       2006-08-06                          Cycle(3)
Impressum