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