1CatalystX::LeakChecker(U3s)er Contributed Perl DocumentatCiaotnalystX::LeakChecker(3)
2
3
4
6 CatalystX::LeakChecker - Debug memory leaks in Catalyst applications
7
9 version 0.06
10
12 package MyApp;
13 use namespace::autoclean;
14
15 extends 'Catalyst';
16 with 'CatalystX::LeakChecker';
17
18 __PACKAGE__->setup;
19
21 It's easy to create memory leaks in Catalyst applications and often
22 they're hard to find. This module tries to help you finding them by
23 automatically checking for common causes of leaks.
24
25 This module is intended for debugging only. I suggest to not enable it
26 in a production environment.
27
29 found_leaks(@leaks)
30 If any leaks were found, this method is called at the end of each
31 request. A list of leaks is passed to it. It logs a debug message like
32 this:
33
34 [debug] Circular reference detected:
35 +------------------------------------------------------+-----------------+
36 | $ctx->{stash}->{ctx} |
37 '------------------------------------------------------+-----------------'
38
39 It's also able to find leaks in code references. A debug message for
40 that might look like this:
41
42 [debug] Circular reference detected:
43 +------------------------------------------------------+-----------------+
44 | $a = $ctx->{stash}->{leak_closure}; |
45 | code reference $a deparses to: sub { |
46 | package TestApp::Controller::Affe; |
47 | use warnings; |
48 | use strict 'refs'; |
49 | $ctx->response->body('from leaky closure'); |
50 | }; |
51 | ${ $ctx } |
52 '------------------------------------------------------+-----------------'
53
54 Override this method if you want leaks to be reported differently.
55
57 Florian Ragwitz <rafl@debian.org> Tomas Doran <bobtfish@bobtfish.net>
58
60 This software is copyright (c) 2010 by Florian Ragwitz.
61
62 This is free software; you can redistribute it and/or modify it under
63 the same terms as the Perl 5 programming language system itself.
64
65
66
67perl v5.36.0 2023-01-20 CatalystX::LeakChecker(3)