CatalystX::LeakChecker(3pm)

CatalystX::LeakChecker3pm

Debug memory leaks in catalyst applications

Usage

    package MyApp;
    use namespace::autoclean;
    extends 'Catalyst';
    with 'CatalystX::LeakChecker';
    __PACKAGE__->setup;

Version

version 0.06

Overview

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.

Methods

found_leaks(@leaks)

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.

Releases

8 releases since Debian 6.0 (Squeeze); the text changed 3 times.

  1. 6.0–9
  2. 10
  3. 11
  4. 12–13

Authors

Florian Ragwitz <[email protected]> Tomas Doran <[email protected]>

From libcatalystx-leakchecker-perl 0.06-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.