GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CatalystX::LeakChecker(3) User Contributed Perl Documentation CatalystX::LeakChecker(3)

CatalystX::LeakChecker - Debug memory leaks in Catalyst applications

version 0.06

    package MyApp;
    use namespace::autoclean;

    extends 'Catalyst';
    with 'CatalystX::LeakChecker';

    __PACKAGE__->setup;

It's easy to create memory leaks in Catalyst applications and often they're hard to find. This module tries to help you finding them by automatically checking for common causes of leaks.

This module is intended for debugging only. I suggest to not enable it in a production environment.

If any leaks were found, this method is called at the end of each request. A list of leaks is passed to it. It logs a debug message like this:

    [debug] Circular reference detected:
    +------------------------------------------------------+-----------------+
    | $ctx->{stash}->{ctx}                                                   |
    '------------------------------------------------------+-----------------'

It's also able to find leaks in code references. A debug message for that might look like this:

    [debug] Circular reference detected:
    +------------------------------------------------------+-----------------+
    | $a = $ctx->{stash}->{leak_closure};                                    |
    | code reference $a deparses to: sub {                                   |
    |     package TestApp::Controller::Affe;                                 |
    |     use warnings;                                                      |
    |     use strict 'refs';                                                 |
    |     $ctx->response->body('from leaky closure');                        |
    | };                                                                     |
    | ${ $ctx }                                                              |
    '------------------------------------------------------+-----------------'

Override this method if you want leaks to be reported differently.

Florian Ragwitz <rafl@debian.org> Tomas Doran <bobtfish@bobtfish.net>

This software is copyright (c) 2010 by Florian Ragwitz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2010-03-26 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.