Leak(3)
π Leak(3) β the perl one π
okay so this is Leak(3), from the User Contributed Perl Documentation girliesss β and bestie, this little page is all about hunting down perl objects that refuse to be reclaimed. it's giving detective energy πβ¨
πΈ NAME πΈ
Devel::Leak β a whole utility for looking for perl objects that are not reclaimed. like, they're just sitting there. living rent free. π
β¨ SYNOPSIS β¨
use Devel::Leak;
... setup code
my $count = Devel::Leak::NoteSV($handle);
... code that may leak
Devel::Leak::CheckSV($handle);
literally that's the whole vibe: snapshot πΈ, run your sus code, then check. iconic.
π DESCRIPTION π
so Devel::Leak has exactly two functions and their names are "NoteSV" and "CheckSV" β dynamic duo, no cap π
"NoteSV" walks the perl internal table of allocated SVs (scalar values) β and yes, that table actually contains arrays and hashes too, the more you know π¦ β and records their addresses in a table. then it returns a count of these "things" and stores a pointer to the table (which it got from the heap using malloc()) in its argument. so like... it's taking attendance πβ¨
"CheckSV" gets passed that argument holding the pointer to the table that "NoteSV" made. it re-walks the perl-internals and calls sv_dump() for any "things" that were not there when "NoteSV" was called. then it returns a count of how many "things" are allocated now. iykyk β the new ones are your suspects π΅οΈββοΈ
π«Ά CAVEATS π«Ά
bestie, read this part, fr fr π
- note that you need a perl built with
-DDEBUGGINGforsv_dump()to print anything at all. but good news: counts are valid in any perl π - if new "things" have been created,
CheckSVmay (also) report additional "things" which are allocated by thesv_dump()code itself. yeah, the tool shows up in its own group chat. lowkey awkward π
πΈ HISTORY πΈ
this little utility module used to be part of Tk π until the variable renaming in perl5.005 made it clear that Tk had no business knowing this much about the perl internals. like ma'am, why do you know that π periodt.
π AUTHOR π
Nick Ing-Simmons <nick@ni-s.u-net.com>
β and that's the page!! slay π¦π
this lil cutie came from perl v5.42.0 and it's dated 2011-12-14 β so it's a vintage icon, and honestly she still eats π
β¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Devel-Leak 0.03-160000.2.2 Β· GPL-1.0 or Artistic-1.0
- opensuse-leap 16.0: perl-Devel-Leak 0.03-160000.2.2 Β· GPL-1.0 or Artistic-1.0
- opensuse-leap 16.0: perl-Devel-Leak 0.03-160000.2.2 Β· GPL-1.0 or Artistic-1.0
- opensuse-leap 16.0: perl-Devel-Leak 0.03-160000.2.2 Β· GPL-1.0 or Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms