Devel::Gladiator(3)

πŸ“¦
version 0.08 Β· 2 versions
, in fedora 43

✨ Devel::Gladiator ✨

okay bestie, so this is the manual page for Devel::Gladiator, a Perl module that literally walks around inside Perl's arena and tells you what's alive in there πŸ’…


🌸 VERSION 🌸

version 0.08 β€” yes she's on 0.08, we love a specific number, no cap πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the vibe, copy-paste ready:

use Devel::Gladiator qw(walk_arena arena_ref_counts arena_table);

my $all = walk_arena();

foreach my $sv ( @$all ) {
    warn "live object: $sv\n";
}

warn arena_table(); # prints counts keyed by class

# how to spot new entries in the arena after running some code
use Devel::Gladiator qw(walk_arena);
my %dump1 = map { ("$_" => $_) } @{walk_arena()};
# do something
my %dump2 = map { $dump1{$_} ? () : ("$_" => $_) } @{walk_arena()};
use Devel::Peek; Dump \%dump2;

πŸŽ€ DESCRIPTION πŸŽ€

so basically, Devel::Gladiator iterates Perl's internal memory structures and it can be used to enumerate all the currently live SVs. every single one. she's thorough like that ✨

and what do you do with that power? two things, iconic behaviour only:

  • hunt leaks πŸ”
  • profile memory usage πŸ“Š

periodt. πŸ’…


πŸ‘‘ EXPORTS πŸ‘‘

🧚 walk_arena

returns an array reference containing all the live SVs. all of them, bestie.

⚠️ huge caveat incoming: this will include a reference back to itself. so when you're done with it you should manually clear this array β€” like @$arena = () β€” otherwise you're literally creating a memory leak while hunting for memory leaks 😭 the irony is giving main character energy in the worst way.

🌈 arena_ref_counts

returns a hash keyed by class and reftype of all the live SVs.

this is the convenient little shortcut for finding out how many objects of a given class exist at a certain point in time. lowkey the most useful thing here, fr fr 🫢

⭐ arena_table

formats a string table based on arena_ref_counts that's suitable for printing. so you can just warn it and stare at your beautiful little table 🌸


πŸ’€ LIMITATIONS πŸ’€

ngl, this code may not work on perls 5.6.x and 5.8.x if PadWalker is installed.

(and the author says, and I quote: "Patches gratefully accepted!" β€” so if you fix it, you're a hero 🫢)


πŸ”₯ SEE ALSO πŸ”₯

go read all of these, they're the friend group πŸ¦‹


🩷 SUPPORT 🩷

got bugs? don't suffer in silence, bestie. bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-Gladiator> β€” or you can email bug-Devel-Gladiator@rt.cpan.org <mailto:bug-Devel-Gladiator@rt.cpan.org> πŸ’Œ


🎀 AUTHOR 🎀

Artur Bergman <sky@apple.com>


πŸ’– CONTRIBUTORS πŸ’–

  • Karen Etheridge <ether@cpan.org>
  • Χ™Χ•Χ‘Χœ Χ§Χ•Χ’'מן (Yuval Kogman) <nothingmuch@woobling.org>
  • Jesse Luehrs <doy@tozt.net>
  • Brad Fitzpatrick <brad@danga.com>
  • mohawk <mohawk2@users.noreply.github.com>
  • Curtis Brandt <curtisjbrandt@gmail.com>

icons, every single one πŸ‘‘


This software is copyright (c) 2006 by Artur Bergman.

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


and that's the whole thing, bestie πŸ’… this page came to you from perl v5.42.0, dated 2025-07-25, and it's the Devel::Gladiator(3) manpage β€” now go walk that arena and clear your arrays, i'm begging you 😭🫢

πŸ“¦ where this page comes from