Chekuri Gautam > Devel-DumpSizes-0.01 > Devel::DumpSizes

Download:
Devel-DumpSizes-0.01.tar.gz

Dependencies

Annotate this POD

Related Modules

Devel::Leak
Devel::Size
more...
By perlmonks.org
View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Devel::DumpSizes - Dump the name and size in bytes (in increasing order) of variables that are available at a give point in a script.

SYNOPSIS ^

use Devel::DumpSizes qw/dump_sizes/;

&Devel::DumpSizes::dump_sizes();

Or,

&Devel::DumpSizes::dump_sizes("/path/of/filename-to-dump-output");

This will print the name of each variable and its size. The name and size are seperated by a '->'

Variable name -> Size in bytes

EXPORTS ^

Exports one subroutine by default:

dump_sizes

DESCRIPTION ^

This module allows us to print the names and sizes of variables that are available at a give point in a script.

This module was written while debugging a huge long running script. The main use being to understand how variable sizes were fluctuating during script execution. It uses PadWalker and Devel::Symdump to get the variables. It uses Devel::Size to report the size of each variable.

METHODS ^

dump_sizes

Usage: &Devel::DumpSizes::dump_sizes();

Or

Usage: &Devel::DumpSizes::dump_sizes("/path/of/filename-to-dump-output");

This method accepts one optional parameter that will be used to create the file where the output is dumped.

If parameter is given then two files will be create. One will have extension .my and will contain my variables. The second file will have extension .ol and will contain our/local variables. If no filename is given output is printed on STDOUT.

As of now, the output is sectioned by printing the following at the start:

        1. either of 'my' or 'our/local' to specify the kind of variables being reported.

        2. output of time().

        3. If possible, subroutine name/line number as returned by caller (perldoc -f caller).

All sizes are in Bytes as returned by Devel::Size. I plan to have more information reported in newer versions.

CAVEATS ^

BUGS ^

AUTHOR ^

Gautam Chekuri gautam.chekuri@gmail.com

COPYRIGHT ^

Copyright (C) 2006 Chekuri Gatuam

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

syntax highlighting: