1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
NAME
Devel::MAT - Perl Memory Analysis Tool
USER GUIDE
NEW USERS:
If you are new to the Devel::MAT set of tools, this is probably not the
document you want to start with. If you are interested in using
Devel::MAT to help diagnose memory-related problems in a perl program
you instead want to read the user guide, at Devel::MAT::UserGuide.
If you are writing tooling modules to extend the abilities of
Devel::MAT then this may indeed by the document for you; read on...
DESCRIPTION
A Devel::MAT instance loads a heapdump file, and provides a container
to store analysis tools to work on it. Tools may be provided that
conform to the Devel::MAT::Tool API, which can help analyse the data
and interact with the explorer user interface by using the methods in
the Devel::MAT::UI package.
File Format
The dump file format is still under development, so at present no
guarantees are made on whether files can be loaded over mismatching
versions of Devel::MAT. However, as of version 0.11 the format should
be more extensible, allowing new SV fields to be added without breaking
loading - older tools will ignore new fields and newer tools will just
load undef for fields absent in older files. As the distribution
approaches maturity the format will be made more stable.
CONSTRUCTOR
load
$pmat = Devel::MAT->load( $path, %args );
Loads a heap dump file from the given path, and returns a new
Devel::MAT instance wrapping it.
METHODS
dumpfile
$df = $pmat->dumpfile;
Returns the underlying Devel::MAT::Dumpfile instance backing this
analysis object.
available_tools
@tools = $pmat->available_tools;
Lists the Devel::MAT::Tool classes that are installed and available.
load_tool
$tool = $pmat->load_tool( $name );
Loads the named Devel::MAT::Tool class.
has_tool
$bool = $pmat->has_tool( $name );
Returns true if the named tool is already loaded.
run_command
$pmat->run_command( $inv );
Runs a tool command given by the Commandable::Invocation instance.
inref_graph
$node = $pmat->inref_graph( $sv, %opts );
Traces the tree of inrefs from $sv back towards the known roots,
returning a Devel::MAT::Graph node object representing it, within a
graph of reverse references back to the known roots.
This method will load Devel::MAT::Tool::Inrefs if it isn't yet loaded.
The following named options are recognised:
depth => INT
If specified, stop recursing after the specified count. A depth of 1
will only include immediately referring SVs, 2 will print the
referrers of those, etc. Nodes with inrefs that were trimmed because
of this limit will appear to be roots with a special name of EDEPTH.
strong => BOOL
direct => BOOL
Specifies the type of inrefs followed. By default all inrefs are
followed. Passing strong will follow only strong direct inrefs.
Passing direct will follow only direct inrefs.
elide => BOOL
If true, attempt to neaten up the output by skipping over certain
structures.
REF()-type SVs will be skipped to their referrant.
Members of the symbol table will be printed as being a 'root' element
of the given symbol name.
PADs and PADLISTs will be skipped to their referring CODE, giving
shorter output for lexical variables.
find_symbol
$sv = $pmat->find_symbol( $name );
Attempts to walk the symbol table looking for a symbol of the given
name, which must include the sigil.
$Package::Name::symbol_name => to return a SCALAR SV
@Package::Name::symbol_name => to return an ARRAY SV
%Package::Name::symbol_name => to return a HASH SV
&Package::Name::symbol_name => to return a CODE SV
find_glob
$gv = $pmat->find_glob( $name );
Attempts to walk the symbol table looking for a symbol of the given
name, returning the GLOB object if found.
find_stash
$stash = $pmat->find_stash( $name );
Attempts to walk the symbol table looking for a stash of the given
name.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>
|