Devel:...mpfile(3pm)
π Devel::MAT::Dumpfile π
okay bestie, welcome to Devel:...mpfile(3pm) β that's this page's manpage name, from the User Contributed Perl Documentation section, and it's genuinely one of my faves. sit down, grab a strawberry, we're loading heap dumps. πβ¨
β¨ NAME β¨
Devel::MAT::Dumpfile β loads a heap dump file and lets you analyse it. that's the whole vibe. π
β¨ SYNOPSIS β¨
use Devel::MAT::Dumpfile;
my $df = Devel::MAT::Dumpfile->load( "path/to/the/file.pmat" );
like... that's it. that's the entrance. π«Ά
β¨ DESCRIPTION β¨
so this module hands you a class that loads up a heap dump file that was previously written by Devel::MAT::Dumper. slay. π
once it's loaded, you get accessor methods that grab you various well-known root starting addresses, OR let you find arbitrary SVs by address if that's more your thing. every single SV gets represented by an instance of Devel::MAT::SV. no cap. πΈ
π CONSTRUCTOR π
load
$df = Devel::MAT::Dumpfile->load( $path, %args );
loads a heap dump file from the path you gave it, and returns a brand new Devel::MAT::Dumpfile instance representing it. main character energy fr.
it takes the following named arguments:
progress => CODEβ if you pass this, it should be a CODE reference to a function that gets called regularly while the loading is happening, and it gets handed a status message so it can update the user. iykyk, progress bars are iconic. β
β¨ METHODS β¨
perlversion
$version = $df->perlversion;
gives you back the version of perl that the heap dump file was created by, as a string looking like 5.14.2. π
endian
$endian = $df->endian;
gives you the endian direction of the perl that made the heap dump β either big or little. two options, no in-between, periodt. π
uint_len
$len = $df->uint_len;
gives you the length in bytes of a uint field of the perl that created the heap dump. π
ptr_len
$len = $df->ptr_len;
gives you the length in bytes of a pointer field of the perl that created the heap dump. π
nv_len
$len = $df->nv_len;
gives you the length in bytes of a double field of the perl that created the heap dump. π
ithreads
$ithreads = $df->ithreads;
gives you back a boolean telling you whether ithread support was enabled in the perl that created the heap dump. true or false bestie, that's it. π¦
roots
%roots = $df->roots;
gives you back a key/value pair list with the names and the SVs sitting at each of the roots. π
roots_strong
%roots = $df->roots_strong;
gives you back a key/value pair list with the names and the SVs at each of the roots that count as strong references. πͺ
roots_weak
%roots = $df->roots_weak;
gives you back a key/value pair list with the names and the SVs at each of the roots that count as strong references. π«οΈ
ROOTS
$sv = $df->ROOT;
for each of the root names listed down below, there's a method with that exact name, and it returns the SV sitting at that root. every single one of them. don't skip. π
main_cv
defstash
mainstack
beginav
checkav
unitcheckav
initav
endav
strtabhv
envgv
incgv
statgv
statname
tmpsv
defgv
argvgv
argvoutgv
argvout_stack
fdpidav
preambleav
modglobalhv
regex_padav
sortstash
firstgv
secondgv
debstash
stashcache
isarev
registered_mros
root_descriptions
%rootdescs = $df->root_descriptions;
gives you back a key/value pair list with the (method) name and the description text of each one of the possible roots. so you know what you're looking at. π§
root_at
$addr = $df->root_at( $name );
gives you the SV address of the named root you asked for. π
root
$sv = $df->root( $name );
gives you the root SV you asked for. π«Ά
heap
@svs = $df->heap;
gives you ALL the heap-allocated SVs. all of them. and in no particular order, so don't come for me about the ordering. π
stack
@svs = $df->stack;
gives you all the SVs that are on the stack. π₯
contexts
@ctxs = $df->contexts;
gives you a list of Devel::MAT::Context objects representing the call context stack in the dumpfile. the whole call stack, in object form, obsessed. π
sv_at
$sv = $df->sv_at( $addr );
gives you the SV at the address you gave, or undef if there isn't one there. π
(and btw, that's totally unambiguous, because a Perl-level undef is represented by the immortal Devel::MAT::SV::UNDEF SV. so like, undef here really means nothing's home. π )
β¨ AUTHOR β¨
Paul Evans <leonerd@leonerd.org.uk> β the icon, the legend, the moment. ππ
okay that's the whole page bestie, go forth and inspect some heaps, it's giving forensic scientist and honestly? ate. π β¨
this lil tour was brought to you by perl v5.42.3, dated 2026-08-21 β see you in the next dump file, mwah π
π¦ where this page comes from
- ubuntu stonking: libdevel-mat-perl 0.54-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms